13
Jan

DMenu and Openbox

Posted on January 13, 2010 by justin

One painful lack in TinyCore Linux that I loved in Linux Mint was the Gnome Do feature. Now, I could just compile Gnome Do and package it as a TCZ extension... but then I've got a fancy tool that requires the entire Gnome stack when I'm using no other part of Gnome - My desktop environment is currently LXDE.

I have, however, found a lightweight alternative, that in some respects is better, and in other respects, not as nice. DMenu isn't as graphically appealing as Gnome Do. Nor does it index your *.desktop entries like Gnome Do. It does give the same quick and easy access to executables on your $PATH, it does not need a process running constantly, and it is amazingly small, requires no other dependencies (Except obviously an X environment -  XVesa and XOrg both work fine), and is fast. Perfect for TIny Core! Just one small problem. By default, it's ugly.

This patch adds enough functionality for me to tweak dmenu's look to the point that it is an acceptable part f my desktop, although the command to run it has gotten a little unwieldy:

dmenu_run -h 150 -ni -p "$" -rs -w 200 -x 540 -y 325 -nb "#000" -nf "#bbb" -sb "#666" -sf "#fff" -i

Also note that the patch is for 3.9 and the current version is 4.0. Despite the version discrepancy, the patch appears to apply cleanly enough to not break any existing features and cleanly add the new features.

Having the application compiled, installed, and configured isn't much good though without a shortcut to launch it. This is where things got a little unstuck. Openbox doesn't like running my dmenu_run command with all it's options. The solution is just to create a wrapper script like so:

$ cat - > /home/tc/.dmenu
#!/bin/sh
exec dmenu_run -h 150 -ni -p "$" -rs -w 200 -x 540 -y 325 -nb "#000" -nf "#bbb" -sb "#666" -sf "#fff" -i
^D
$ chmod +x /home/tc/.dmenu

And next up is to edit /home/tc/.config/openbox/rc.xml. Find the keyboard section and add something like this:

    <keybind key="W-space">
      <action name="Execute">
          <execute>/home/tc/.dmenu</execute>
      </action>
    </keybind>

Restart Openbox, and now the key combo of Windows+Space launches dmenu. Now launching terminals, browsers, and what have you just takes a few keystrokes, instead of trying to navigate menus or find my desktop!

Comments

0 comments have been posted.

Post a comment