Search code examples
xmonaddmenu

In XMonad, Mod-p (dmenu_run) displays an empty menu


When I hit MOD-p in XMonad, I used to get a list of commands. Now I just get an empty menu. If I type the name of an executable on my path and hit the carriage return, the command executes as expected. But why aren't any programs listed in the menu? Solution is posted below.


Solution

  • By default, XMonad maps MOD-p to dmenu_run. (You can see the default key bindings in the source code on github.) So I tried launching dmenu_run from the command line and saw the same behaviour; a blank menu that allows me to type the name of an executable in my path.

    The problem was that the file ~/.cache/dmenu_run was empty. When I deleted this file and ran dmenu_run again, it worked perfectly (and created a new, non-empty ~/.cache/dmenu_run). I think the problem happened when I added a definition of $XDG_CACHE_HOME to my .zshrc file and the cache somehow got blanked out.