You are not logged in.

#1 2013-01-30 23:46:36

HeadphonesMcGee
Member
Registered: 2012-09-05
Posts: 13

[SOLVED] dmenu and $PATH

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

#2 2013-01-30 23:52:47

HeadphonesMcGee
Member
Registered: 2012-09-05
Posts: 13

Re: [SOLVED] dmenu and $PATH

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

#3 2013-01-31 01:00:10

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: [SOLVED] dmenu and $PATH

HeadphonesMcGee wrote:

Am I not setting the path correctly?

It would be really helpful if you could first show how you do it.

Offline

#4 2013-01-31 18:02:34

HeadphonesMcGee
Member
Registered: 2012-09-05
Posts: 13

Re: [SOLVED] dmenu and $PATH

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

#5 2013-01-31 19:07:27

bgc1954
Member
From: Edmonton, AB, Canada
Registered: 2006-03-14
Posts: 1,160

Re: [SOLVED] dmenu and $PATH

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

#6 2013-01-31 19:19:10

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: [SOLVED] dmenu and $PATH

HeadphonesMcGee wrote:

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

#7 2013-01-31 21:06:01

HeadphonesMcGee
Member
Registered: 2012-09-05
Posts: 13

Re: [SOLVED] dmenu and $PATH

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

#8 2013-01-31 21:10:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,445
Website

Re: [SOLVED] dmenu and $PATH

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

#9 2013-01-31 21:34:00

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: [SOLVED] dmenu and $PATH

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

#10 2013-02-01 00:22:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,445
Website

Re: [SOLVED] dmenu and $PATH

Cool thanks for the clarification -- and good 'research'.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#11 2013-02-01 01:35:41

msthev
Member
Registered: 2012-04-05
Posts: 177

Re: [SOLVED] dmenu and $PATH

I'd prefer a dotfiles repo, but I just needed something to confirm that you login through a TTY, so there you go tongue

Offline

Board footer

Powered by FluxBB