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 gmail.com
Fri Aug 11 06:59:01 UTC 2017


Hi,

Thanks Michal.  How to use Dbus API directly to get the same results?.
I think loginctl is missing in some old distros.


Thank you,

Sai Prasanna

On Wed, Aug 2, 2017 at 9:24 PM, Michal Srb <msrb at suse.com> wrote:

> Hi,
>
> I would say a systematic way to do it is using the systemd/logind dbus api.
>
> You can see the information using the command line tool:
>
> # loginctl show-seat seat0
> Id=seat0
> ActiveSession=1              <- interesting
> CanMultiSession=yes
> CanTTY=yes
> CanGraphical=yes
> Sessions=1564 1
> IdleHint=no
> IdleSinceHint=0
> IdleSinceHintMonotonic=0
>
> # loginctl show-session 1
> Id=1
> User=1000
> Name=michal
> Timestamp=Mon 2017-07-24 08:42:22 CEST
> TimestampMonotonic=42458199
> VTNr=7
> Seat=seat0
> Display=:0               <- interesting
> Remote=no
> Service=xdm-np
> Scope=session-1.scope
> Leader=3132              <- interesting
> Audit=1
> Type=x11
> Class=user
> Active=yes
> State=active
> IdleHint=no
> IdleSinceHint=0
> IdleSinceHintMonotonic=0
>
>
> No idea about reliable way to find the authority file. Parsing the X's
> command
> line would probably work in most cases.
>
> Michal Srb
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg/attachments/20170811/a5517575/attachment.html>


More information about the xorg mailing list