diff --git a/users/youwen/linux/hyprland/common.nix b/users/youwen/linux/hyprland/common.nix index 628aba9..af22c56 100644 --- a/users/youwen/linux/hyprland/common.nix +++ b/users/youwen/linux/hyprland/common.nix @@ -378,9 +378,26 @@ services.hypridle = { enable = true; settings = { - lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/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. + general = { + lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/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 = 1500; + on-timeout = "loginctl lock-session"; + } + { + 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. + } + { + timeout = 1800; + on-timeout = "systemctl suspend"; + } + ]; }; }; }