Monday, March 28, 2005

Automatically launch X11


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

No comments:

Post a Comment

Mastering Matter: Seamless Smart Home Integration with Network Segmentation

I’ve been intrigued by the idea of integrating devices with Matter for some time. My smart home setup includes a pair of SwitchBot Hubs, som...