hypridle icon indicating copy to clipboard operation
hypridle copied to clipboard

loginctl lock-session dispatcher resets brightnessctl -s set 10% dispatcher

Open izmyname opened this issue 1 year ago • 2 comments

As in the issue name, screenlocking resets the lower brightness listener, thus delaying the following listeners.

Here's the config.

general {
    lock_cmd = pidof hyprlock || hyprlock       # avoid starting multiple hyprlock instances.
    before_sleep_cmd = loginctl lock-session    # lock before suspend.
    after_sleep_cmd = hyprctl dispatch dpms on  # to avoid having to press a key twice to turn on the display.
}

listener {
    timeout = 120                                # 2 min.
    on-timeout = brightnessctl -s set 10%        # set monitor backlight to 10%
    on-resume = brightnessctl -r                 # monitor backlight restore.
}

listener {
    timeout = 300                              #5 min
    on-timeout = loginctl lock-session 
}

listener {
    timeout = 330                                 # 5.5min
    on-timeout = hyprctl dispatch dpms off        # screen off when timeout has passed
    on-resume = hyprctl dispatch dpms on          # screen on when activity is detected after timeout has fired.

izmyname avatar Jul 23 '24 07:07 izmyname

More generally, any listener's on-timeout seems to trigger the on-resume of another listener (or at least loginctl does). With the following two listeners (short time for testing purposes):

listener {
    timeout = 18                     
    on-timeout = loginctl lock-session # Lock screen when timeout has passed
}

listener {
    timeout = 24                          
    on-timeout = hyprctl dispatch dpms off # Screen off when timeout has passed
    on-resume = hyprctl dispatch dpms on   # Screen on when activity is detected after timeout has fired
}

The intended effect is that after 18 seconds, the lock screen is triggered, and then 6 seconds after that, the screen turns off. However, it seems that the first lock screen on-timeout causes the entire timeout to be reset, and it has to wait another 24 seconds before turning off the screen.

Rehpotsirhc-z avatar Aug 17 '24 02:08 Rehpotsirhc-z