[OS X TeX] Re: PS on TeX Switcher
Peter Dyballa
Peter_Dyballa at Web.DE
Sat Nov 25 12:21:00 CET 2006
Am 25.11.2006 um 11:19 schrieb Joachim Kock:
> In an sense I am sympathetic with the idea of setting PATH in
> the environment.plist file. I think it is the only logical
> continuation of the unix tradition. But then the shells should
> respect it too, i.e., the initialisation files should not
> overwrite the PATH but only add to it... It is logical, because
> the idea of setting the PATH in initialisation files is that
> they are read by the outermost processes, the shells (hence the
> name). But that was the case in classical unix. Now the
> situation is different since there are GUI programs running
> outside a shell. So it is logical to move the PATH setting a
> step up and have it in an environment.plist file read by the
> login process.
>
> The main opponent to the environment.plist mechanism is the
> i-Installer who claims it can't work reliably if it inherits
> a PATH it doesn't control. I don't understand this argument.
> If i-Installer wants to control the PATH, it should just set it
> itself. (This last sentence is not meant as an instruction,
> but rather as an illustrationo of my lack of understanding.)
Right.
Shells can learn from ~/.MacOSX/environment.plist:
export PATH=$(defaults read "${HOME}/.MacOSX/environment" PATH)
MANPATH=$(defaults read "${HOME}/.MacOSX/environment" MANPATH)
export MANPATH
set path=(`defaults read ~/.MacOSX/environment PATH | tr ':' ' '`)
setenv MANPATH `defaults read ~/.MacOSX/environment MANPATH`
This is the proper Mac OS X way to make sure that a low level UNIX
shell or programme has the same fundamental settings as a high level
Aqua application.
For my set of shell scripts to integrate X11 and TeX in a multi-user
environment (Make X11 aware of TeX on a Mac.app) the launching X
server writes via ~/.xinitrc the DISPLAY value into ~/.MacOSX/
environment.plist:
defaults write ${HOME}/.MacOSX/environment "DISPLAY" $DISPLAY
because now its value is determined. A user's .login or .bash_profile
file provides an "alias" (kind of a shell function) to update the
DISPLAY setting if the Terminal was launched before X11 that reads
from ~/.MacOSX/environment.plist the true DISPLAY value (this "alias"
has to be used actively, i.e. it has to be invoked on the command
line, because now the Terminal's set-up is finished, every further
change has to be done actively by the user). And when X shuts down it
removes its change to ~/.MacOSX/environment.plist again via .xinitrc:
defaults delete ${HOME}/.MacOSX/environment "DISPLAY"
updisp () { export DISPLAY=`defaults read "${HOME}/.MacOSX/
environment" DISPLAY` ; }
alias updisp 'setenv DISPLAY `defaults read "${HOME}/.MacOSX/
environment" DISPLAY`'
It's so easy to handle ~/.MacOSX/environment.plist ...
--
Greetings
Pete
"A mathematician is a machine that turns coffee into theorems."
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
More information about the macostex-archives
mailing list