hyprwm / hypridle

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

Lock event resumes all listeners #108

Open rmsc opened 5 days ago

rmsc commented 5 days ago

When a listener is triggered Lock event is received, it seems to resume all listeners. Not sure if this happens by design, but it's not what I would expect.

With the test config bellow, the screen dims, then turns off, and then comes back on again after locking. I believe it should stay off even when locking is happening:

general {
    lock_cmd = pidof hyprlock || hyprlock
    before_sleep_cmd = loginctl lock-session
    # turn on screen after sleep
    after_sleep_cmd = hyprctl dispatch dpms on
}

# Reduce monitor brightness on early idle
listener {
    timeout = 5
    on-timeout = light -O && light -S 2
    on-resume = light -I
}
listener {
    timeout = 10
    on-timeout = hyprctl dispatch dpms off
    on-resume = hyprctl dispatch dpms on
}
listener {
    timeout = 15
    on-timeout = loginctl lock-session
}

Here's the relevant log output:

(...)
[LOG] found 3 rules
[LOG] wayland done, registering dbus
[LOG] Using dbus path /org/freedesktop/login1/session/_31
[LOG] Idled: rule 55a4dbb10050
[LOG] Running light -O && light -S 2
[LOG] Executing light -O && light -S 2
[LOG] Process Created with pid 195944
[LOG] Idled: rule 55a4dbb10098
[LOG] Running hyprctl dispatch dpms off
[LOG] Executing hyprctl dispatch dpms off
[LOG] Process Created with pid 195953
ok
[LOG] Idled: rule 55a4dbb100e0
[LOG] Running loginctl lock-session
[LOG] Executing loginctl lock-session
[LOG] Process Created with pid 195958
[LOG] Got dbus .Session
[LOG] Got Lock from dbus
[LOG] Locking with pidof hyprlock || hyprlock
[LOG] Executing pidof hyprlock || hyprlock
[LOG] Process Created with pid 195965
[LOG] Resumed: rule 55a4dbb10050
[LOG] Running light -I
[LOG] Executing light -I
[LOG] Process Created with pid 195988
[LOG] Resumed: rule 55a4dbb10098
[LOG] Running hyprctl dispatch dpms on
[LOG] Executing hyprctl dispatch dpms on
[LOG] Process Created with pid 195990
[LOG] Resumed: rule 55a4dbb100e0
[LOG] Ignoring, onRestore is empty.
ok
(...)

This also happens when we switch the order to dim->lock->dpms, which is arguably the most common use case. When the lock event comes, the screen lights up and stays that way until the dpms listener gets triggered.

vaxerski commented 5 days ago

IIRC this is fixed in hyprland-git, what is your hyprland version?

rmsc commented 4 days ago

This is with hypridle-0.1.4, hyprland-0.42.0.

I just noticed there's a new 0.1.5 release, does it include the fix? Thanks!

vaxerski commented 4 days ago

hyprland release. 0.42.0 is very, very outdated.