A Mac-owning friend was reasonably showing off his almost-one-click Lorem Ipsum generator, and I wondered if I could do the same in Ubuntu: not just have local generation of lipsum text for Greeking out example content; but also have it so I can summon it entirely from the keyboard, almost without having to stop typing.
It's pretty straightforward to set up, actually. First, you need to download the lorem-ipsum-generator .deb package from http://code.google.com/p/lorem-ipsum-generator/downloads/list. Then, assuming it's gone into your Downloads directory, run:
% sudo dpkg -i ~/Downloads/lorem-ipsum-generator_0.3-2_all.deb
It should install with no further prompting on recent Ubuntu implementations. Run the following to work out where it's installed:
% which lorem-ipsum-generator /usr/local/bin/lorem-ipsum-generator
It'll almost always be in /usr/local/bin. Next, open System > Preferences > Keyboard Shortcuts and select "Add". Add a shortcut called "Lorem Ipsum" and use the command "/usr/local/bin/lorem-ipsum-generator -g -p N", where N is the number of paragraphs you'll want to generate at once. You should see this new shortcut at the bottom of the list. Click on the text saying "Disabled" and when the text changes to "New shortcut..." press your desired shortcut combination: on a PC I use START-l, for (l)ipsum. Using the START or Apple key prevents conflict with existing shortcuts.
Now, to copy some lipsum text into your current buffer, you can press:
- START-l (lorem-ipsum-generator opens)
- ALT-e (text copied to clipboard, and generator closes)
- CTRL-v (copy clipboard into your current application)
Three meta keys aren't ideal, but I'm hamstrung by the built-in shortcuts for lorem-ipsum-generator and Ubuntu's clipboard respectively. But that should be it: if you've got a well-behaved application then when you CTRL-v you should be back in the textarea or editing window you just left, and your lipsum should appear. All together now: lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt....