Re: Finding my $DISPLAY programatically.
Re: Finding my $DISPLAY programatically.
- Subject: Re: Finding my $DISPLAY programatically.
- From: Jeremy Huddleston <email@hidden>
- Date: Fri, 2 May 2008 13:59:27 -0700
On May 2, 2008, at 13:18, Bill Janssen wrote:
Some of the remote systems are quite old and don't all have ssh
Is there any reason why you can't install ssh on these ancient
machines?
Jeremy, asking this poor fellow to run around and find an SSH server
to run on 10-year-old SunOS machines (if that's what he has -- it's
what I have, so I'm projecting here), then install it on all of those
machines (thousands?), when he obviously has no need for it, just so
that Apple's X11 will continue to work for him on newer Apple
machines, is a bit much.
If it's a 10 year old Sun box, then it's probably running Solaris 7
which installs ssh by default.
Is there a way to programmatically translate the launchd style
DISPLAY
(i.e. /tmp/launch-idaF18/:0) into a usable DISPLAY (i.e.
172.16.1.1:0.0)?
How about
#!/bin/sh
MYIP=`ifconfig -a | grep 'inet' | grep 'broadcast' | awk '{print
$2}'`
echo `echo $DISPLAY | sed -e "s;^.*:;${MYIP}:;"`
No, that just does the same exact thing as ${MYIP}:0 because the end
of the launchd $DISPLAY is always ':0'
If you really need to figure this out, then your best option is
grepping for it out of ps or editing xinitrc to save it to a file:
$ cat /usr/X11/lib/X11/xinit/xinitrc.d/50-store-DISPLAY.sh
#!/bin/sh
echo DISPLAY: $DISPLAY
echo $DISPLAY > ${HOME}/.x11-display
--Jeremy
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden