{pkgs , ... }: { services.hypridle = { enable = true; settings = let dpmsCommand = "${pkgs.hyprland}/bin/hyprctl dispatch dpms"; brightnessSet = "${pkgs.brightnessctl}/bin/brightnessctl -s %% brightnessctl s"; # brightnessSet = "${pkgs.brightnessctl}/bin/brightnessctl"; in { general = { lock_cmd = "pidof swaylock || swaylock"; # avoid starting multiple swaylock instances. # unlock_cmd = "notify-send 'unlock!'" before_sleep_cmd = "${dpmsCommand} off"; after_sleep_cmd = "${dpmsCommand} on"; ignore_dbus_inhibit = false; }; listener = [ { timeout = 180; on-timeout = "${brightnessSet} 15%"; on-resume = "brightnessctl -r"; } { #comment out if no keyboard backlight timeout = 200; on-timeout = "brightnessctl -sd asus::kbd_backlight set 0"; on-resume = "brightnessctl -rd asus::kbd_backlight"; } { timeout = 300; on-timeout = "loginctl lock-session"; } { timeout = 600; on-timeout = "${dpmsCommand} off"; on-resume = "${dpmsCommand} on"; } { timeout = 900; on-timeout = "systemctl suspend"; # on-timeout = "${brightnessSet} 0% && systemctl suspend"; # on-resume = "brightnessctl -r"; } ]; }; }; }