|
|
#1 |
|
Triple-A Player
Join Date: May 2003
Location: homeless
Posts: 111
|
$PATH environment in X11
If i start X11 from my dock it doesnt have the $PATH i specified in my .cshrc (which is logical), ive also tried adding the following to my .xinitrc but doesnt work either:
PATH=$PATH:/sw/bin:/sw/sbin export PATH creating a environment.plist in ~/.MacOSX didnt help either, it even breaks X11 somehow when i use the enviroment.plist, it will skip your ~/xinitrc and use the default.. Has anyone else encountered this problem? |
|
|
|
|
|
#2 |
|
Triple-A Player
Join Date: May 2003
Location: homeless
Posts: 111
|
never mind, i just fixed my problem by changing my X11 application items to:
XMMS - export PATH=$PATH:/sw/bin:/sw/sbin;xmms this also fixes the esd problem.. |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Jan 2002
Posts: 10,677
|
Personally, I set my path in my .login.
|
|
|
|
|
|
#4 |
|
Triple-A Player
Join Date: May 2003
Location: homeless
Posts: 111
|
that doesnt seem to get executed when you start X11 from the dock.
|
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jan 2002
Posts: 10,677
|
You're right it doesn't.. what's up with that?! You could put:
Code:
source .login |
|
|
|
|
|
#6 |
|
League Commissioner
Join Date: Jan 2002
Posts: 5,536
|
it works for some cases. subshells would get redundant instances of elements in PATH if one uses yellow's method.
it's better to test if you're an X11 term and not a subshell in .xxxrc and if so, then do the path mangling that is done in .login if [ $SHLVL = 2 ]; then echo foo; fi if [ $TERM = 'xterm' ]; then echo foo; fi or something like that. one must understand those two conditions above in an xterm window.
__________________
On a clear disk, you can seek forever. |
|
|
|
|
|
#7 | |||||||||||||||||||
|
Triple-A Player
Join Date: May 2003
Location: homeless
Posts: 111
|
wont that be the same if you put your path in .tcshrc? since .tcshrc just calls .login then.. But wont work either since X11 doesnt call .cshrc anyway, i just fixed it to add the path in every X11 item i have. kinda overkill but it works as it should. I dont know which file X11 initializes.. |
|||||||||||||||||||
|
|
|
|
|
#8 | |||||||||||||||||||
|
Moderator
Join Date: Jan 2002
Location: Singapore
Posts: 4,237
|
Two possible ways to have a complete *global* PATH variable: 1- One could use the ~/.MacOSX/environment.plist, but it will give the same environment variables to *all* applications and that can create problems. 2- A "wrapper script". (Tip from Martin Costabel) It's an evil hack, but one would hope that this kind of hack will not be necessary for the final version of X11.app: A. Rename /Applications/X11.app/Contents/MacOS/X11 to /Applications/X11.app/Contents/MacOS/X11.bin B. Write a shell script named /Applications/X11.app/Contents/MacOS/X11 containing, for example: Code:
#!/bin/tcsh source /etc/csh.login source /etc/csh.cshrc exec /Applications/X11.app/Contents/MacOS/X11.bin C. If you don't understand any details of the points A. or B., then, don't even try to do this. You are on your own. If you do this correctly, clicking on the X11 icon will work as before, but X11 will come up with a complete set of environment variables. |
|||||||||||||||||||
|
|
|
|
|
#9 |
|
Moderator
Join Date: Jan 2002
Posts: 10,677
|
Sweet.. that's *($&@# genius! It works like a charm! Naturally I sub'd my own .tcshrc & .login since I'm the only person who uses this machine. Thanks Sao!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|