Using dmenu in Devuan
Copyright (C) 2016 by Steve Litt. This document is free content licensed via the GNU GPL version 2. This document has NO WARRANTY!
This document describes the usage of dmenu based on questions what, how and why.
dmenu is a lightweight, keyboard-centric menu program from Suckless.org that makes running programs lightning fast for the touch typist. For the touch typist, dmenu is much faster than the system menu, even if one uses the keyboard to operate the system menu.
dmenu starts with a cached list of all runnable programs from $PATH. The list is sorted alphabetically, with programs starting with the sequence you typed sorting to the top, and programs containing that sequence below.. Then, as you type characters, it eliminates programs not containing the sequence of characters you typed. So for instance,
Here's how to install and use dmenu:
dmenu is perfectly functional as installed, as long as you have spectacular vision and are able to quickly search that little top stripe. Most people, however, want bigger letters with more contrast, and they want the menu to go down the page, not across the top. This subsection guides you in making a separate shellscript to do exactly that...
#/bin/sh dmenu_run -fn 10x20 \ -nf yellow -nb black \ -sf black -sb white \ -l 20

If you had to type dmenu_mine for every program you wanted to run, dmenu would be useless. It's only when you associate a quick and easy hotkey, easily available from the touch-typist's home position, that dmenu assumes its true power.
Different window managers and desktop environments have different ways of associating hotkeys with executable programs like dmenu_run. This document describes how to set Ctrl+Shift+space as the hotkey for dmenu_mine for LXDE and for Devuan's default desktop environment, Xfce.
There's no completely GUI point and click method to set hotkeys within LXDE. It requires some file editing. These instructions assume you use gvim. If you use emacs or joe or nano, just substitute the appropriate editor command. Here's how you do it:
<keybind key="S-C-space">
<action name="Execute">
<command>dmenu_mine</command>
</action>
</keybind>
Follow the directions for LXDE, except instead of editing ~/.config/openbox/lxde-rc.xml, edit ~/.config/openbox/rc.xml.
Nominally, the way you use dmenu is to press the dmenu hotkey (Ctrl+Shift+space in our example), enter the first few keystrokes of the program name, and press Enter. But what if...
Many times you need to add arguments to programs on the path. For instance, perhaps you always like to open gvim with three windows, so you normally type gvim -o3 on the command line. So what you might do is make a shellscript called gv3, on the path, that does nothing but gvim -o3. Now you run dmenu and just type gve<Enter>.
Perhaps you occasionally need your program to prompt you for arguments. You can use a shellscript to do that too, although it's beyond the scope of this document.
dmenu saves countless keystrokes, and therefore time. But sometimes there are so many similar programs with identical starting letters that dmenu would be slower than reaching for the mouse. For instance, if you often use xfce4-settings-manager, to get it down to a single entry on which to press Enter, you'd need to enter the following keystrokes: xfce4-settings-m. Less keystrokes wouldn't distinquish it from xfce4-settings-editor. From an efficiency standpoint, this is an abomination.
No problem. Create a shellscript, on the path, called xfmg. Now you just run dmenu and type in xfmg<Enter>. This is quicker than the time it takes to reach for the mouse, let alone navigate the mouse and return to home position.
Installing and using dmenu does not in any way limit your ability to use tools you're already using, such as your window manager's system menu, the window manager's GUI run box, nor the Command Line Interface. If your right hand were already on the mouse, you'd click on the window manager's system menu, rather than returning to keyboard home position to use dmenu. dmenu is one more tool you can use to make life easier and faster.
Installing dmenu will not in any way put your existing computer setup in jeopardy. It has very few dependencies. Nothing you use regularly would be deleted or changed by installing dmenu. There's absolutely no cost to installing dmenu, and it just might turbocharge your computer productivity.
Why use dmenu? Truth be told, not everybody should. The hunt-and-peck, 10 word per minute typist should use the mouse, because dmenu is 100% keyboard centric. The person prioritizing "new" or "pretty" over productivity won't use dmenu. It looks like a user interface from 30 years ago, and it's ugly.
But it's lightning fast in the hands of a touch typist. In less time than it takes to position his hand on the mouse, the touch typist can type Ctrl+Shift+space and libr<Enter>, and be running Libreoffice. Ctrl+Shift+space and icew<Enter> has you running Iceweasel.
For those of us using a user interface without a panel, a user interface like Openbox, Blackbox, Fluxbox, twm and the like, dmenu is even more important. Often, the likelihood of finding a blank spot on the desktop to click is bleak. But always, the likelihood of pressing Ctrl+Shift+space (or whatever other hotkey you decide to assign to dmenu) is 100%, and it's a fast operation.
If you're anything like me, the more you use dmenu, the more you love it.