This page looks plain and unstyled because you're using a non-standard compliant browser. To see it in its best form, please upgrade to a browser that supports web standards. It's free and painless.

Paul's Time Sink

| Main | Albums |

Automatically launch X11

Paul Westbrook | 28 March, 2005 09:05

I just saw this tip in a comment for this hint on macosxhints.  By adding these lines to your .profile, your shell will automatically launch X11 when you start a shell, and you are not connected via ssh.

# if we're NOT ssh'd in
if [ ! ${SSH_TTY} ]; then
# make sure X is running
if [ "`ps -x | awk '{print $5}' | grep X11`" = "" ]; then
open /Applications/Utilities/X11.app &
# then refocus Terminal.app
osascript -e 'tell application "Terminal" to activate'
fi
# if DISPLAY isn't set
if [ x${DISPLAY} = x ]; then
export DISPLAY=:0
fi
fi

Powered by LifeType
Design by Book of Styles