hyprwm / hypridle

Hyprland's idle daemon
BSD 3-Clause "New" or "Revised" License
320 stars 16 forks source link

Use separate `ignore_systemd_inhibit` config param for systemd. Register ScreenSaver object under multiple paths. #59

Closed yawor closed 1 month ago

yawor commented 1 month ago

This MR introduces separate ignore_systemd_inhibit configuration parameter, which controls whether hypridle respects systemd inhibits or not.

Second change is that both ignore_dbus_inhibit and ignore_systemd_inhibit parameters are processed early in CHypridle::setupDBUS(). This means that if ignore_dbus_inhibit is set, then no attempt to register org.freedesktop.ScreenSaver object is made, but hypridle will still respect the systemd.

This gives the ability to use a different daemon which registers this object in parallel to hypridle. One example of such daemon would be https://github.com/bdwalton/inhibit-bridge, which registers its own ScreenSaver object and forwards ScreenSaver inhibits as systemd inhibits. Systemd inhibits are more flexible, as there can be multiple programs monitoring systemd inhibits, but there can be only one program, which registers ScreenSaver object.

I've also added the ability to register multiple ScreenSaver objects under different paths for historic reasons. Originally the ScreenSaver object lived under the /ScreenSaver path. Some browsers seem to still use the legacy path. For now two paths are hardcoded (/org/freedesktop/ScreenSaver and /ScreenSaver), but it could be made in the future so that it is also configurable. This should fix #44.