{ pkgs, ... }: { services.swayidle = { enable = true; systemdTarget = "hyprland-session.target"; timeouts = let dpmsCommand = "${pkgs.hyprland}/bin/hyprctl dispatch dpms"; brightnessCommand = "${pkgs.brightnessctl}/bin/brightnessctl -s %% brightnessctl s"; in [ { #timeout 180 timeout = 3; command = "${brightnessCommand} 15%"; resumeCommand = "brightnessctl -r"; } { #timeout 300 timeout = 5; command = "${dpmsCommand} off && swaylock"; resumeCommand = "${dpmsCommand} on"; } { #timeout 420 timeout = 7; command = "${brightnessCommand} 0%"; resumeCommand = "brightnessctl -r"; } ]; # events.before-sleep.event = "swaylock"; }; }