Any reliable way to find the X11 display id and authority file for local session running in actual monitor.

Sai Prasanna sai.r.prasanna at
Tue Aug 1 12:01:53 UTC 2017


I am developing a remote support product. It is like a vnc server. I have
used xcb for screen capturing and input simulation.

My use case is as follows.

1) I have a service that runs as root, this service does many actions other
than remote support stuff.
2) This service is responsible for invoking my remote support binary, for
unattended/attended access.

I want to do the following

1) If local user has not logged in or is in login screen, start my remote
desktop process as root with DISPLAY= the id of display manager greeter.
Here the problem is , how to
  > Detect that user is in login screen if there are multiple logged in
users across different dms (If I try starting my agent with the display id
and xauthority files of logged in users, my screen capture data using xcb
is black)
  > Find the xauthority file of the display manager login screen across
multiple dms like kdm , light dm etc (or is lightdm becoming defacto?)

2) If local user is logged in, find this user as their  display is active
(xcb screen capture doesn't give a horrid blank) and also the display id
and xauthority files.

The thing is I don't want to create new virtual displays, connect to the
one that is actually used. I know there is no idea of "current" display in
X11, but even if multiple displays are active, if I connect to one in
background, it gives no data as I suspect the desktop environment is
stopped for that display.

I understand this question might not be directly releavant to x11 alone and
may involve display manager specific stuff, but my knowledge of X, display
managers etc is  quite currently limited.

Thank you,

R. Sai Prasanna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the xorg mailing list