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


Click here to return to the 'Use other terminal apps with Apple's X11' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use other terminal apps with Apple's X11
Authored by: isd_glory on Aug 26, '04 12:32:33PM
Rather than modifying xinitrc so X11 launches a terminal, I've modified xinitrc not to launch a terminal. This way you can somewhat do things in reverse by having your terminal program launch X11 instead. After modifying xinitrc, paste the following into your ~/.profile :
# 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
This way, any time you open Terminal.app, it sets itself up the X diaplay and makes sure X11 is running. It's a pretty simple solution if you don't mind X11 being active all the time. Additionally, it;s pretty easy to customize that one AppleScript line to suit your preferred terminal.

(I apologize if it appears i'm taking credit for that little script snippet; I found it somewhere on macosxhints a while ago, and cant seem to find a reference.)

[ Reply to This | # ]