config dmenu not picking up user $PATH
When running dmenu
, my local $HOME/bin
scripts aren't being picked up. So I checked the value of $PATH
by writing a cheat script that dmenu would run.
Sure enough, $HOME/bin
was not included in the output:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
So perhaps the culprit is how .bashrc
is configured?
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Aha!
So I move the $PATH
assignment in .bashrc
before it can exit for not running interactively:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
But still no luck. My current workaround is to change the config
file to call a script with a wrapped dmenu command, dmenu.sh
:
bindsym $mod+d exec ~/bin/dmenu.sh
The contents of my ~/bin/dmenu.sh
:
#!/bin/bash
PATH=~/bin:$PATH dmenu_run
Does anyone have a better solution?
My environment: Xubuntu 14.04