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

Peter Dyballa Peter_Dyballa at Web.DE
Sun Nov 26 05:29:32 EST 2006


Am 26.11.2006 um 03:06 schrieb Joachim Kock:

> 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.

Or the X server had crashed before.

I decided to make :0 the default DISPLAY for any shell and any user  
from shell RC files. When the first X server launches it kind of re- 
uses this value legally. If a second user (for example my admin  
account) was running and it invokes some X client it opens on the  
first user's display (without authorisation)! If the second user  
launches X11, ~/.xinitrc corrects the value of DISPLAY, except that  
old shells have still the old and faulty value. Updisp has to be  
invoked actively.

In a situation when a second user logs in and launches X11 after the  
first one has done the same (i.e. a second X server is invoked),  
DISPLAY is automatically incremented without having to code anything.  
But then a shell in Terminal would have a faulty DISPLAY setting. So  
I have written some code that looks up some process names (X11,  
XDarwin, Finder OR loginwindo OR ATSServer OR SystemUIServer OR Dock  
OR pbs ...) and tries to correct the initial DISPLAY value.

I can let you my code, it might improve. It is quite useful to set up  
a usable X11 environment by one mouse click (as a Platypus  
application) – and this useful X11 environment only works because  
~/.MacOSX/environment.plist has values for PATH, MANPATH, ... which  
X11 inherits and can pass to all of its clients. It really took me  
weeks (some ten hours) to find out that it does not work to set these  
values in ~/.xinitrc or shell RC files. Bash users will have less  
faults than (t)csh users, but I can imagine that besides the TclTk  
script texdoctk others will also fail.

--
Greetings

   Pete

"Specifications are for the weak and timid!"


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