There are two screen saver options in Redhat 6.6 menu "System->Preference->Screensaver":
- 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;
- 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 command 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.