|
|
Use other terminal apps with Apple's X11
Sorry, but this hint is a terrible idea. There are plenty of good ways to use iTerm, Terminal, or whatever terminal you want with X but this isn't one of them. Any time you find yourself replacing a system file with a script it's a pretty good hint that you're doing something wrong. To do it right:
Use other terminal apps with Apple's X11
Using "csh" (I don't know about "bash") n8gray's "complication":
...but that can cause complications if you're connecting to your machine remotely and it only works if you use bash as your shell. Can be solved using the following in ".login":
if ($?REMOTEHOST) then
setenv DISPLAY ${REMOTEHOST}:0.0
else
setenv DISPLAY :0.0
endif
when the remote system is a Mac.
Use other terminal apps with Apple's X11
This is the bash version:
if [ -z "$DISPLAY" ]; then if [ -n "$REMOTEHOST" ]; then export DISPLAY=$REMOTEHOST:0.0 else export DISPLAY=:0.0 fi fiand indeed it is ok if you are only user on your Mac: I have this on my Powerbook. You may add/merge with an hint submitted by Christoph in May this year: # 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 DISPLAYthe files in /tmp increments with users starting their X11 on their sessions so it sets the DISPLAY correctly with multiple users and FUS.
Use other terminal apps with Apple's X11
Good idea but there's one flaw with what you're doing:
Solution?
A possible alternative to the problems with the DISPLAY variable taking on other values - arrange for your .xinitrc file to place the DISPLAY variable in a file like '.x11appdisplay' in your home directory, and parse its contents if the X11.app is found to be running on the start of a shell. I'll leave the details of this as an exercise for the reader based on other posted scripts! |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.14 seconds |
|