I want to write a script that runs in the background and detects when a user logs out. I am having trouble finding documentation on a dbus monitor. The best I can do is that I see that I am excited EndSessionQuery , EndSession and EndSessionResponse , but they all have logical values, so they cannot be completely trusted (maybe the program says that it does not want the user to exit? ) and, besides, what if no programs are open? This is too unreliable.
I want to listen to a signal that will always occur when a user logs out. Can anyone provide this signal? I am currently executing this command:
dbus-monitor --session \ "type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'" | \ myprog
which captures ScreenSaver events. But I also want to catch a way out. I wish for something like:
dbus-monitor --session \ "type='signal',interface='org.gnome.Session',member='LogoutSuccess'" \ "type='signal',interface='org.gnome.ScreenSaver',member='ActiveChanged'" | \ myprog
source share