API for finding out whether your X monitor is on the current VT

Dave Airlie airlied at gmail.com
Sat Jun 17 23:39:41 PDT 2006

> I've been looking, without success so far, for an existing extension +
> API that'll allow me to find out whether my X session is on the current
> VT (Virtual Terminal) ?
> In other words, on a computer with many concurrent X sessions (or an
> active console user), is my X session currently being displayed and so
> will likely to get the user's attention?
> I'd appreciate any pointers. I can envision a way to do this that'll
> work on a local machine and require root (to access /dev/console), but
> I'd rather avoid that.

You should be able to use the root window property XFree86_VT and the
Linux fgconsole command to do it, not sure how to do it for remote
clients, as calling fgconsole isn't probably possible.

It might be possible to add another root window property if the
current X server is active.


> Thanks.
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg

More information about the xorg mailing list