Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding my $DISPLAY programatically.




On May 2, 2008, at 17:57, Bill Janssen wrote:

 #!/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'

Really? His original message said:

The problem with a hard coded DISPLAY is that if X11.app crashes it
often runs again with a different DISPLAY, it won't go back to 0:0
until a reboot, also if another user uses fast user switching and runs
another X11.app it is not 0:0.


The launchd socket is always /tmp/launchd-XXXXXXXX/:0

The unix socket may be different.

I'm assuming he means "0.0".  So, I guess we need to know what the
difference is -- I was just presuming that it was a different major
display number.  So, when X11.app "runs again", what does it do?

It takes the next available X11 DISPLAY as determined by /tmp/.X##- lock ... but the launchd socket basename is always :0


--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)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/x11-users/email@hidden

This email sent to email@hidden

References: 
 >Finding my $DISPLAY programatically. (From: Robert Tillyard <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: "Mark J. Reed" <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Robert Tillyard <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Jeremy Huddleston <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Bill Janssen <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Jeremy Huddleston <email@hidden>)
 >Re: Finding my $DISPLAY programatically. (From: Bill Janssen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.