[Xquartz-dev] 2.3.2_rc4

Martin Costabel costabel at wanadoo.fr
Sun Dec 21 02:05:47 PST 2008


Jeremy Huddleston wrote:
> 
> Would someone who uses tcsh give me an example ~/.x11run that I can 
> place in the FAQ here:
> 
> http://xquartz.macosforge.org/trac/wiki/X11-UsersFAQ#Howcanmylauncedapplicationsinheritmytcshenvironment 

Based on the contributions to this thread, I have now an X11 wrapper
script that works for me both with bash and tcsh login shells. Here is
my /Applications/Utilities/X11.app/Contents/MacOS/X11 script:


  #!/bin/bash --login
  cmd="$(dirname $0)"/X11.bin
  args="${@}"
  exec -l "$SHELL" -c "exec $cmd $args"


(Of course, if you want to reestablish the ~/.x11run hook, you can add
the corresponding line, but I for one won't need it any more with this
wrapper script).

This script reads the login startup scripts for bash and for tcsh login 
shells.

The "--login" flag makes bash read its login scripts, and the "exec -l"
lets the user's startup shell "$SHELL" read its login scripts. At least
for tcsh it does this. For bash, if "--login" is omitted, it will not 
read the login scripts, despite the "exec -l".

Concerning other login shells, I made some quick tests for ksh and zsh 
that confirmed that the script works as intended.

-- 
Martin













More information about the Xquartz-dev mailing list