Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use dbus signals to inhibit #90

Open
miclaraia opened this issue Feb 5, 2023 · 0 comments
Open

use dbus signals to inhibit #90

miclaraia opened this issue Feb 5, 2023 · 0 comments

Comments

@miclaraia
Copy link

I noticed that there are currently two flags for inhibiting screen idle, one based on whether a window is full-screen, and another for when audio is playing. A third option could be to listen for dbus events org.freedesktop.ScreenSaver Inhibit and Uninhibit. The currently available flags --not-when-fullscreen, and --not-when-audio are not suitable for users who want their screens to dim when audio is playing in the background, but don't want dimming while watching a non-fullscreen video in e.g. a browser. xfce-screensaver describes similar functionality in their docs:

Inhibit
Request that saving the screen due to system idleness be blocked until UnInhibit is called or the calling process exits.


Here is an excerpt from dbus-monitor when starting and pausing a video in firefox:

method call time=1675597447.179251 sender=:1.801 -> destination=org.freedesktop.ScreenSaver serial=56 path=/ScreenSaver; interface=org.freedesktop.ScreenSaver; member=Inhibit
   string "firefox"
   string "video-playing"
...
method call time=1675597449.572570 sender=:1.801 -> destination=org.freedesktop.ScreenSaver serial=57 path=/ScreenSaver; interface=org.freedesktop.ScreenSaver; member=UnInhibit
   uint32 1651872344

And an excerpt for playing/pausing a video in vlc:

method call time=1675598374.664767 sender=:1.2436 -> destination=org.freedesktop.ScreenSaver serial=5 path=/ScreenSaver; interface=org.freedesktop.ScreenSaver; member=Inhibit
   string "vlc"
   string "Playing some media."
...
method call time=1675598376.934975 sender=:1.2436 -> destination=org.freedesktop.ScreenSaver serial=6 path=/ScreenSaver; inter
face=org.freedesktop.ScreenSaver; member=UnInhibit
   uint32 1476071733
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant