Using dmenu in Xubuntu 11.04

First draft May 2nd 2011, Keith Burnett, ping.keith@gmail.com

Xubuntu 11.04 uses the XFCE desktop environment which provides a shortcut for maximising a window so that the window decoration (title bar &c) does not show and so the window covers the panels. Alt-F11 is the shortcut assigned to this.

I like to bring other applications up while using (say) OpenOffice maximised in this way. There is a shortcut that will bring up the main menu (ESC-Ctrl), but then you have to navigate the menu.

This miniHowTo explains how to use the dmenu program from the dwm window manager (in the Ubuntu repositories) to launch applications by pressing a short cut (I've set mine to Super/Windows-Space), typing the name of the application, and pressing enter. The new application window has focus when it loads.

This howto has been tested on a stock install of Xubuntu 11.04 using compositor. I have no idea if it will work with compiz or other window managers with effects enabled. Feedback on that or any other aspect is welcome.

Step 1: install dmenu

From terminal, run

sudo apt-get install dmenu

and type your admin password when prompted

Apt will tell you that dmenu is part of the 'suckless tools package' and mention the window manager dwm, and then install the software

Step 2: Populate a cache of all the applications

From terminal run the command

dmenu_path

and you should see a list of applications printed to the terminal screen. This list is also saved as .dmenu_cache in your home directory. You may need to run this command when you install software, depending on how the software is installed. Installing Seamonkey from the Ubuntu Software Centre resulted in .dmenu_cache being updated.

Step 3: Test from terminal

From terminal run the command

dmenu_run

You should see a list of applications appear in 'terminal' style type at the very top of your screen on top of the upper panel.

Type the name of a program (e.g. 'mousepad'). As each letter is typed you should see the applications that match the currently typed letters appear in the line at the top of the screen.

When you have typed enough letters so that only the application you want appears, press the enter key. The application should load.

You can press ESC to abort a search and quit dmenu_run. The terminal is matched as x-t, short for x-terminal-emulator. I'm fiddling with aliases and the application cache to try to define more user meaningful names.

Step 4: add a shortcut to XFCE

I chose to bind the key combination Super-Space to dmenu-run. XFCE 4.8 allows you to define key shortcuts to any program using the settings manager. Just

  1. Select Menu | Settings | Settings Manager from the main menu
  2. Click the Keyboard icon in the Settings Manager
  3. Click the Application Shortcuts tab
  4. Click Add
  5. Write 'dmenu_run' in the command box that appears
  6. When prompted for the short cut keys, press Super and Space (or the combination you prefer)
  7. If the combination is in use, you will see an error message and be invited to type another
  8. Click OK and close the Settings Manager and Keyboard windows
  9. Test your new shortcut

References