digitaltrails / vdu_controls

VDU controls - a control panel for monitor brightness/contrast/...
GNU General Public License v3.0
114 stars 3 forks source link

It would be good to suspend activity if the session is locked or in screensaver mode. #46

Closed digitaltrails closed 12 months ago

digitaltrails commented 1 year ago

It would be good to suspend activity if the session is locked or in screensaver mode. Currently vdu_controls periodically re-tries talking to the screen.

The screen saver status can be queried via DBUS. The command line query is:

% dbus-send --session --dest=org.freedesktop.ScreenSaver --type=method_call --print-reply /org/freedesktop/ScreenSaver org.freedesktop.ScreenSaver.GetActive

It would seem likely this would work on KDE/Gnome and X11/Wayland, but that needs to be verified.

In python we might use a dbus monitoring option (which would require another dependency).

Something to think about.

Side note: this thought was prompted by trying to find what was bringing my monitors out of suspension. The cause was pipewire. A script played a sound when mail arrives - it seems like pipewire is the cause, it didn't happen prior to pipewire.

digitaltrails commented 12 months ago

Reluctant to add more dependencies just to reduce logging noise and save a bit of CPU.