I was using gnome-do as my application launcher through out last year with my ubuntu 9.04 installation. I installed it right after installing 10.04 recently too. But I kinda needed a change. I realized I wasn’t using the launcher THAT MUCH so it better be lightweight. So I found dmenu. A nifty tool coming with ‘dwm’ window manager. I also found yeganesh, a wrapper around dmenu which lists most used app first. Yeganesh is written in haskell. Not that I don’t like haskell but let’s go with python yeganesh clone called pydmenu since ubuntu has python installed by default.
First install dmenu which is in dwm-tools on Ubuntu repositories.
$sudo aptitude install dwm-tools
Then download pydmenu, extract it and copy it in to /usr/local/bin
$ wget http://www.codercpf.be/stuff/pydmenu.tar.bz2 $ tar xjfv pydmenu.tar.bz2 $ sudo cp pydmenu.py /usr/local/bin/
create a file named dmenu-bind.sh inside /usr/bin/local and put following code in it.
#!/bin/bash exe=`pydmenu.py` && eval "exec $exe"'
Or just run following command and it’ll automatically do it for you.
$ echo -e '#!/bin/bash\nexe=`pydmenu.py` && eval "exec $exe"' | sudo tee /usr/local/bin/new.sh
You should change persmission of the file too
$ sudo chmod 755 /usr/local/bin/dmenu-bind.sh
OK enough playing in goofy command line. Let’s go on the surface and set up a shortcut key combination for our new launcher.
Go to System > Preferences > keyboard Shortcuts and press Add button to add a new shortcut. A dialog box called Custom Shortcut will show up. type in dmenu as the name and dmenu-bind.sh as the command and press Apply. Now you’ll see your new shortcut entry under Custom Shortcuts. We need to set the key combination now. For that click on Disabled (in ‘shortcut’ column) in the new entry. It’ll change to New Shortcut… Now press the key combination you prefer. (ex: press ctrl + space) Make sure the combination will not clash with others. I chose Super key (Some people call it windows key.) and Space (Super Key + Space) which is the default for Gnome-Do. Close the keyboard shortcut window.
Now you can press the key combination you chose and see how it goes typing in few characters of your fave app’s name. Use arrow keys to move between suggested applications and Enter to run. You can dismiss dmenu with Esc.
PS: You can change the looks and orientation of dmenu editing dmenu command in pydmenu.py file (/usr/local/bin/pydmenu.py) with help of man dmenu.
And it obviosly is not sexy :D