Opened 15 years ago

Last modified 12 years ago

#33 accepted enhancement

use dbus get notifications of screensaver state changes — at Version 4

Reported by: Antoine Martin Owned by: Antoine Martin
Priority: minor Milestone: 0.12
Component: Client Keywords:
Cc:

Description (last modified by Antoine Martin)

On linux we use xlib to know the "idle time" of the X session and compare that against the timeout value.

We could just do something more similar to what we do on win32 and get notifications when the screensaver is (de)activated:

dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver',member='SessionIdleChanged'"

More information about the dbus interface, and in particular the ActiveChanged signal in the gnome-screensaver doc

The FAQ contains an example of actions using dbus-monitor: perform_actions_when_the_screensaver...

For reference, the win32 code is track-session-events (from the great win32_how_do_i)

Synergy+ has a bug entry with useful links in it: Support for gnome-screensaver as well as xscreensaver

Some other useful pointers:

Change History (4)

comment:1 Changed 15 years ago by Antoine Martin

Summary: use dbus to learn about screensaver state changesuse dbus get notifications of screensaver state changes

comment:2 Changed 14 years ago by Antoine Martin

Owner: changed from Antoine Martin to Antoine Martin
Status: newaccepted

Seeing the painful bugs we had with avahi/dbus python integrating with twisted (removed them in r1626), it might be difficult to integrate this asynchronous dbus stuff with twisted... not sure. If it is, maybe we could just launch a separate process to shield us from this (and monitor/parse its output): very ugly solution but also much safer!

Last edited 13 years ago by Antoine Martin (previous) (diff)

comment:3 Changed 14 years ago by Antoine Martin

Found code that does exactly that (both as a process and with direct dbus calls): http://nxsy.org/getting-amarok-to-pause-when-the-screen-locks-using-python-of-course

comment:4 Changed 13 years ago by Antoine Martin

Description: modified (diff)
Note: See TracTickets for help on using tickets.