Not strictly wxPython-related, but:
Does anyone know of a good way to determine whether a program is being
displayed on a remote X server instead of the local display? I want
to disable a button (responsible for launching a crash-prone OpenGL
viewer) if it's remote. I didn't have much luck Googling this; my
best guess is that I can look at $DISPLAY but I'm not sure exactly
what to check for - blank host name?. Or is there some intrinsic
wxPython feature that will give me this information?
thanks,
Nat
Does anyone know of a good way to determine whether a program is being
displayed on a remote X server instead of the local display?
no, but see this old message (2004):
http://osdir.com/ml/python.wxpython/2004-03/msg00294.html
in there is code that checks if an XServer is running locally. That
may not help, in principle, you could have an Server running locally,
but not have it be the one you are currently connected to, but it may
catch the common case.
my
best guess is that I can look at $DISPLAY but I'm not sure exactly
what to check for - blank host name?.
that _may_ work too, but I don't know how guarnteed it is. For
instance, on my OS-X box, I get
/tmp/launch-mlHSon/org.x:0
whether X is running or not.
but I'm not sure what that means
-Chris
···
On Wed, Jan 9, 2013 at 1:14 PM, Nat Echols <nathaniel.echols@gmail.com> wrote:
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov
In my case it won't matter, since the Mac (or Windows) client can't be
displayed remotely anyway - I'm already checking for OS type first.
-Nat
···
On Wed, Jan 9, 2013 at 1:28 PM, Chris Barker - NOAA Federal <chris.barker@noaa.gov> wrote:
my
best guess is that I can look at $DISPLAY but I'm not sure exactly
what to check for - blank host name?.
that _may_ work too, but I don't know how guarnteed it is. For
instance, on my OS-X box, I get
/tmp/launch-mlHSon/org.x:0
whether X is running or not.
but I'm not sure what that means
well, in theory, both Mac and Windows supports X -- and it's actually
used in OS-X a fair bit. But you're right, the point of wx is to not
do that!
It was just meant as an example of what oddities one might find in $DISPLAY
-Chris
···
On Wed, Jan 9, 2013 at 1:31 PM, Nat Echols <nathaniel.echols@gmail.com> wrote:
In my case it won't matter, since the Mac (or Windows) client can't be
displayed remotely anyway - I'm already checking for OS type first.
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov