[OS X TeX] DISPLAYs (was: Re: PS on TeX Switcher)

Joachim Kock jkock at start.no
Sat Nov 25 21:06:22 EST 2006

Hello Pete,

> 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`'

This is all very interesting.  I will make some experiments and think
a little bit more about it.

Alpha's way of tackling this problem of DISPLAYs in a multiuser situation
is based on the observation that the X11 displays are listed as sockets
in /tmp/.X11-unix/.  Now simply see if there is a display socket owned by 
the current user...  This works very well, except that I seem to recall 
I figured out that the trick might fail in some situations where there 
are two physical screens attached to the same machine.  Not too sure what 
the problem was.)

------------------------- 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 MacOSX-TeX mailing list