You are not logged in.
I recently installed a new program in /opt/NewProgramDir
I added this directory to my $PATH variable first via .bashrc then via .bash_profile. I rebooted. From the terminal I can type the program name and use autocomplete because the shell 'knows' where the program is located. dmenu (or maybe dmenu_run more specifically) cannot find this program. I thought it just used the environment variable $PATH? I also tried deleting .dmenu_cache so things would get regenerated but that did not help. What is going on here?
Last edited by HeadphonesMcGee (2013-01-31 21:07:27)
Offline
I should add that terminator finds the app fine, but xterm does not. Am I not setting the path correctly? I am using dwm as my WM by the way.
Offline
Am I not setting the path correctly?
It would be really helpful if you could first show how you do it.
Offline
Of course:
in ~/.bashrc I have the line:
export PATH=$PATH:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/R2011a/bin:/opt/zotero
in ~/.bash_profile I have the same line:
export PATH=$PATH:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/R2011a/bin:/opt/zotero
The application I'm trying to run is in the folder /opt/zotero. The binary is called 'zotero'. I read about how interactive login bash shells read from ~/.bash_profile (after /etc/profile). Interactive non-login shells read from /etc/bash.bashrc and then ~/.bashrc. After I put the PATH declaration in both ~/.bashrc and ~/.bash_profile, xterm 'finds' zotero. However I still cannot get dmenu to 'find' it. I did delete .dmenu_cache again (after I added both of the aforementioned places) and it still did not work. So where does dmenu get it's 'PATH' variable?
Offline
Try deleting ~/.cache/dmenu_run. I believe that's the new default.
Time is a great teacher, but unfortunately it kills all its pupils ... - Louis Hector Berlioz
Offline
I read about how interactive login bash shells read from ~/.bash_profile (after /etc/profile). Interactive non-login shells read from /etc/bash.bashrc and then ~/.bashrc.
If I'm not mistaken, dmenu's environment could be non-interactive (depending on your login method). Try putting the line in ~/.profile.
Offline
msthev was correct. I simply added the PATH variable to ~/.profile and everything worked after I rebooted the machine and then deleted .dmenu_cache. Although my home machine is an arch box, my work machine is an Ubuntu box running 10.04 LTS (so .dmenu_cache is where the configs are located). To reiterate: it seems dmenu's environment is non-interactive so it would read ~/.profile at start. Thanks for your help, everyone. I appreciate it.
Offline
dmenu_run does get entries from my $PATH as set in ~/.bashrc and my ~/.bashrc is not sourced from (~/.|/etc/)profile or anywhere else.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
If this is still how you login, then it is to be expected; dmenu inherits its environment from the shell. In HeadphonesMcGee's case login is done by some login manager, therefore it is non-interactive, therefore it does not read ~/.bashrc (or ~/.bash_profile) at all.
Offline
Cool thanks for the clarification -- and good 'research'.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'd prefer a dotfiles repo, but I just needed something to confirm that you login through a TTY, so there you go
Offline