{ config, pkgs, ... }: { programs.hypridle = { enable = true; settings = { general = { lock_cmd = "pidof hyprlock || hyprlock"; before_sleep_cmd = "loginctl lock-session"; after_sleep_cmd = "hyprctl dispatch global quickshell:lockFocus"; inhibit_sleep = 3; }; listener = [ { timeout = 300; on-timeout = "loginctl lock-session"; } { timeout = 600; on-timeout = "hyprctl dispatch dpms off"; on-resume = "hyprctl dispatch dpms on"; } { timeout = 900; on-timeout = "systemctl suspend || loginctl suspend"; } ]; }; }; # Make sure the hypridle package is installed home.packages = [ pkgs.hypridle ]; }