detect the screensaver [SOLVED] sort of

Antoine Martin antoine at
Fri Sep 18 04:58:56 PDT 2009


After much wasted time looking at "_SCREENSAVER_STATUS" and talks of
using dbus, gconf and what not, I found this snippet of python code
which calls XScreenSaverQueryInfo.
This gives me the idle time, but the state is *always* 3 (rather than
Is there another extension which can be used to figure out if the screen
is locked?


Antoine Martin wrote:
> Hi,
> What is the official way of detecting when the screensaver is activated?
> I thought it might be the "_SCREENSAVER_STATUS" property of the root
> window so I tried running:
> while true; do xprop -root _SCREENSAVER_STATUS; done
> And then starting the screensaver with gnome-screensaver-command -l
> Nothing showed up. I must be missing something obvious.
> Is this documented anywhere?
> Cheers
> Antoine
> PS: apologies if this is not the correct list, I can't think of a better
> one.

More information about the xorg mailing list