[Xquartz-dev] Environment passed to Applications-launched processes

Glenn Eychaner geychaner at mac.com
Thu Sep 25 07:10:41 PDT 2008


OK, I finally got around to testing this comprehensively on my system  
(10.5.5 and X11 2.3.1).  Here's what I did, in detail:

1) I created a file .MacOSX/environment.plist containing two  
environment variables (TESTVARIABLE and TESTVARIABLE2).
2) In the X11 Applications menu, I created two entries: 'xterm -ls',  
and 'env > /tmp/X11_env.txt'.
3) I created an applescript in Script Editor containing the single line:
	do shell script "env > /tmp/Applescript_env.txt; cd $HOME; /usr/X11/ 
bin/xterm -ls"
4) I logged out and logged back in.

Test 1: Launching from a Terminal
1) I opened a Terminal window.  'env | grep TEST': positive
2) In the terminal window, I typed 'xterm -ls' to open an xterm.  In  
the resulting xterm, 'env | grep TEST': positive
3) Created a new xterm from the X11 Applications menu.  In the  
resulting xterm, 'env | grep TEST': NEGATIVE
4) Created the /tmp/X11_env.txt file from the X11 Applications menu.   
'grep TEST /tmp/X11_env.txt: NEGATIVE

Test 2: Launching from Applescript
1) Opened Script Editor and ran the Applescript from there.  (I could  
also save it as an Application; makes no difference.)
2) In the resulting xterm:  'env | grep TEST': positive
3) Created a new xterm from the X11 Applications menu.  In the  
resulting xterm, 'env | grep TEST': NEGATIVE
4) Created the /tmp/X11_env.txt file from the X11 Applications menu.   
'grep TEST /tmp/X11_env.txt: NEGATIVE
5) 'grep TEST /tmp/Applescript_env.txt: positive

Test 3: Launch from the Utilities directory.
1) Launched X11 from the Utilities directory.  This opened X11 and an  
xterm.
2) In the resulting xterm:  'env | grep TEST': positive
3) Created a new xterm from the X11 Applications menu.  In the  
resulting xterm, 'env | grep TEST': positive
4) Created the /tmp/X11_env.txt file from the X11 Applications menu.   
'grep TEST /tmp/X11_env.txt: positive

I don't have an .xinitrc file.  The only conclusion I can draw is that  
X11 is NOT picking up the environment.plist file when it auto-launches  
through the DISPLAY variable, but is when it launches from the  
Utilities directory.

-G.
--
Glenn Eychaner (geychaner at lco.cl)
Telescope Systems Programmer, Las Campanas Observatory



More information about the Xquartz-dev mailing list