2

There are two screen saver options in Redhat 6.6 menu "System->Preference->Screensaver":
(1) The option "Active screen saver when computer is idle". Check this option will cause the screen saver is active when the idle time reach the limit;
(2) The option "Lock screen when screen saver is active". Check this option will cause the screen locked when the screen saver is active; otherwise, the screen will not locked when the screen saver is active.

My question is that how to monitor the screen lock/unlock if the option (1) is checked? I tried to use the dbus command:
dbus-monitor --session "interface='org.gnome.ScreenSaver'"

Unfortunately, the result is not correct as it only catch the message "ActiveChanged", even I check the option (2) and the screen is locked actually.
signal sender=:1.37 -> dest=(null destination) serial=25 path=/org/gnome/ScreenSaver; interface=org.gnome.ScreenSaver; member=ActiveChanged boolean true

If I run the commnad "gnome-screensaver-command -l" manually, the dbus-monitor can catch the following message:
method call sender=:1.99 -> dest=org.gnome.ScreenSaver serial=3 path=/org/gnome/ScreenSaver; interface=org.gnome.ScreenSaver; member=Lock
signal sender=:1.37 -> dest=(null destination) serial=23 path=/org/gnome/ScreenSaver; interface=org.gnome.ScreenSaver; member=ActiveChanged boolean true

I referred the document of org.gnome.ScreenSaver:
https://people.gnome.org/~mccann/gnome-screensaver/docs/gnome-screensaver.html
It seems the method call "Lock" means "Request that the screen be locked."
The signal "ActiveChanged" only means the screen saver is active or not.

So I suspect this is a Redhat 6.6 bug:
The message "Lock" is missed when the screen saver is active and the screen is locked by the above two options.
It cause I can't detect the screen locked or not in this scenario.

Is there any workaround solution for this issue? Is it possible that I can read the config file that store the above two options?

Thanks.

1

Running gconftool-2 --get /apps/gnome-screensaver/lock_enabled will return a boolean telling you if screen locking is enabled for the current user. If it is true, you'll know that when the "ActiveChanged" signal is true, the screen is also locked.

Since you asked about the config file for both options, you can also check if the screensaver is set to activate itself with gconftool-2 --get /apps/gnome-screensaver/idle_activation_enabled.

  • This is now untrue. In Ubuntu 16, pressing any key turns off the screensaver but keeps the screen locked. – Cerin Oct 3 '16 at 22:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.