Re: Finding my $DISPLAY programatically.
Re: Finding my $DISPLAY programatically.
- Subject: Re: Finding my $DISPLAY programatically.
- From: Bill Janssen <email@hidden>
- Date: Sat, 3 May 2008 17:17:26 PDT
- Comments: In-reply-to Bill Janssen <email@hidden> message dated "Sat, 03 May 2008 16:14:24 -0700."
Robert's Objective-C program further qualifies those ports by using
"Xquartz" as the program name, and dp dropped me a note pointing out
that modern Macs may have multiple IP addresses, particularly with
Parallels or Fusion installed. So here's an updated script:
#!/bin/sh
MYPORT=`lsof -i tcp:6000-6040 | grep "Xquartz.*${USER}.*IPv4.*(LISTEN)" | awk '{print substr($9, 3) - 6000}'`
MYIP=`ifconfig -a | grep 'inet.*broadcast' | head -1 | awk '{print $2}'`
echo ${MYIP}:${MYPORT}
Bill
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden