Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A workaround for X11 sharing by multiple users' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A workaround for X11 sharing by multiple users
Authored by: Christoph on May 03, '04 02:38:46AM
In contrast to the strong opinion of some posters I need to say that this is not a bad idea. The problem with open-x11 (which is just a wrapper script around "open -a X11 xapp" BTW) is that you cannot pass command line arguments to the application. Say you want to load the file bla.txt in emacs or bla.ps in gv. This is not possible with open-x11. Here is a Bourne shell compatible version of the above code:

# try to figure out DISPLAY cleverly
DISPLAY=""
for x in 0 1 2 3 4 5 6 7 8 9
do
  if [ -O /tmp/.X$x-lock ]
      then
      DISPLAY=:$x.0
      break
  fi
done
if [ -z "$DISPLAY" ]
    then
    echo "$USER has no X11 DISPLAY open" 1>&2
    exit 1
fi
export DISPLAY
I have written an open-x11 replacment "open-xapp" which is available from http://lionel.kr.hs-niederrhein.de/~dalitz/data/software/macosx/open-xapp

[ Reply to This | # ]
A workaround for X11 sharing by multiple users
Authored by: EccentricAnomaly on Aug 17, '04 11:21:22AM

Wrap the code above in logic to check if $DISPLAY is already set first. This way you can be logged into your Mac using x11 and can also ssh in remotely from another machine and have x11 display properly both locally and remotely.



[ Reply to This | # ]