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: szedula on Aug 26, '04 09:24:34PM
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.

[ Reply to This | # ]
Use other terminal apps with Apple's X11
Authored by: MaxMarino on Aug 27, '04 09:31:10AM
This is the bash version:
if [ -z "$DISPLAY" ]; then
    if [ -n "$REMOTEHOST" ]; then
        export DISPLAY=$REMOTEHOST:0.0
    else
        export DISPLAY=:0.0
    fi
fi
and 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 DISPLAY
the files in /tmp increments with users starting their X11 on their sessions so it sets the DISPLAY correctly with multiple users and FUS.

[ Reply to This | # ]