i3 dmenu does not browse $PATH

Delete ~/.cache/dmenu_run or ~/dmenu_cache, depending on which you have, and log back in. After your PATH is reloaded from .profile after logging in, dmenu should regenerate the cache from $PATH. dmenu seems to be bad about renewing its own cache, and needs to be forced to do it sometimes.

Also check that you have enabled the executable bit for script:

$ ls -l ~/.local/bin/test.sh
-rwxrwxrwx 1 user group 152 Jan 11 04:09 /home/user/.local/bin/test.sh

I had the same problem.

This Arch Linux forum post describes the problem:

Setting $PATH in ~/.bashrc doesn't ensure your WM/dmenu will inherit this env.
A more relevant question to ask is, "How do you login?" Usually the env exported in ~/.bash_profile or ~/.profile are available in your X applications.
Launch dmenu_run as you normally do, then in dmenu, type
echo $PATH > /tmp/path
Then in a terminal, cat /tmp/path to see what that $PATH is.

In my case, $PATH directories set in my ~/.profile weren't picked up by dmenu. My window manager is started from .xinitrc, and adding an additional export PATH=$PATH:/dir/of/interest in the .xinitrc file before the exec my_wm line fixed the problem. It is a bit clunky though.

As noted previously, I had to remove the ~/.cache/dmenu_run file and log in again after making the change to get it to work.

Tags:

I3

Dmenu