Using dmenu in Pekwm and Openbox
During my recent stint trying out wmii, I’ve grown very quickly accustomed to dmenu. After only using it for a few hours, I fell in love with it: it is so convenient to launch an application when you don’t have your hands on the mouse; launch dmenu, just type a few letters from the application name, make sure you have the right app selected, press enter and your app shows up.
So I began to wonder whether it is possible to run dmenu or something similar in Openbox and Pekwm, and it is.
First, you’ll need to install dmenu. You can download the source code from the dwm/wmii website and install that (’sudo make clean install’ in Ubuntu).
To launch dmenu in Openbox and Pekwm, I use the following command:
$(dmenu_path | dmenu -b -nb '#E0E9D0' -sb '#a6b38d' -sf '#070806')
This launches dmenu at the bottom of the screen (-b), with a colour scheme to match the Aeterna Openbox and Gtk theme. You can change the settings (everything that comes after ‘dmenu’ in the above command) to suit your preferences; read the man pages (’man dmenu’) to see what options you have.
I have this bound to Alt+F3 in both Pekwm and Openbox (Alt+F1 launches the root menu and Alt+F2 launches gmrun). In Pekwm, I added the following to keys file:
KeyPress = "Mod1 F3" { Actions = "Exec $(dmenu_path | dmenu -b -nb '#E0E9D0' -sb '#a6b38d' -sf '#070806') &" }
To get dmenu to work in Openbox was a little more complex. If I added the above command to the rc.xml file dmenu wouldn’t launch (Openbox-Message: Failed to execute ‘$(dmenu_path | dmenu’)’: Failed to execute child process “$(dmenu_path” (No such file or directory) say the xsessions-errors.). I’ve tried adjusting the command in several ways, but couldn’t find one that did work, so I ended up creating a script to launch dmenu in Openbox. It is very straightforward:
For a green theme matching Aeterna’s Openbox and GTK theme at the bottom of the screen
#!/bin/sh
`dmenu_path | dmenu -b -nb '#E0E9D0' -sb '#a6b38d' -sf '#070806'` && eval “exec $exe”
For a grey/black/white matching Darkness Returns GTK/OB theme (from #!) at the top of the screen.
#!/bin/sh
`dmenu_path | dmenu -nb '#a1a1a1' -sb '#ffffff' -sf '#000000'` && eval “exec $exe”
I saved the file as dmenu.sh in ~/bin, where I keep all my scripts, made it executable (chmod +x ~/bin/dmenu.sh), and added the following to the rc.xml file
For Openbox, this is what I added in the <keyboard> section of the rc.xml file:
<keybind key="A-F3">
<action name="Execute">
<execute>/home/<username>/bin/dmenu.sh</execute>
</action>
</keybind>
In Pekwm, you can use this command in the Keys file, but in Openbox you’ll still have to use a script to launch dmenu (as explained above).
This should also work in other window managers, such as Fluxbox, or desktop environments like Xfce, though I haven’t tried it.
During my recent stint trying out wmii, I’ve grown very quickly accustomed to dmenu. After only using it for a few hours, I fell in love with it: it is so convenient to launch an application when you don’t have your hands on the mouse; launch dmenu, just type a few letters from the application name, make sure you have the right app selected, press enter and your app shows up.
So I began to wonder whether it is possible to run dmenu or something similar in Openbox and Pekwm, and it is.
During my recent stint trying out wmii, I’ve grown very quickly accustomed to dmenu. After only using it for a few hours, I fell in love with it: it is so convenient to launch an application when you don’t have your hands on the mouse; launch dmenu, just type a few letters from the application name, make sure you have the right app selected, press enter and your app shows up.
So I began to wonder whether it is possible to run dmenu or something similar in Openbox and Pekwm, and it is.







