local/remote how to detect?
Bert Wesarg
wesarg at informatik.uni-halle.de
Tue Jul 3 02:56:09 PDT 2007
Josh Triplett wrote:
> Bert Wesarg wrote:
>> Carsten Haitzler (The Rasterman) wrote:
>>> On Mon, 02 Jul 2007 23:15:24 +0200 Bert Wesarg <wesarg at informatik.uni-halle.de>
>>> babbled:
>>>
>>>> Tiago Vignatti wrote:
>>>>> Bert Wesarg escreveu:
>>>>>> Hello All,
>>>>>>
>>>>>> [ Maybe a FAQ ]
>>>>>>
>>>>>> is it possible to reliable detect if me (the X client) is remote or local
>>>>>> to the X server?
>>>>> Maybe the 'xlsclients' tool. The first row of the output will tell which
>>>>> machine the client is connected.
>>>> Thanks, indeed a nice tool. unfortunelatly the client i'm interested (a
>>>> motif one) is not even listed when all is running local (and yes I used
>>>> option -a and -l)! all other things like xmms, gkrellm are listed.
>>> all xlsclients does it walk the window tree and look at window properties for
>>> title, name/class etc.
>>>
>>> as i suggested before. try create an xshmimage - this will only succeed if you
>>> are local. tonnes of sample code out there on how to do this (its more than 1
>>> step).
>> Yeah I will look into this, but your first response sounds a little bit
>> like a joke.
>
> No joke; raster's solution should do what you want.
One minor question: how can an extension be a reliable way to detect
local/remote connection? If the extension is missing the 'reliable' is gone!
But I know that the XShm is very old, and should be present on all modern
machines.
Bert
>
>> I just see that the mplayer checks for a display number < 10 to decide
>> whether the display is local or remote. how reliable is this? is this
>> somewhere documented?
>
> Not reliable at all. SSH normally creates remote X displays starting at 10;
> this mplayer hack will handle that one case, but not any other cases of remote
> displays, and it can misclassify local displays as remote if they have a high
> number (which can legitimately happen).
>
> - Josh Triplett
>
More information about the xorg
mailing list