hypridle: add options for lock, dpms and suspend timeouts

This commit is contained in:
Tigor Hutasuhut 2024-09-02 20:52:27 +07:00
parent 4786f0562b
commit c3bc08a3f0
2 changed files with 22 additions and 4 deletions

View file

@ -14,18 +14,18 @@ in
}
listener {
timeout = 600
timeout = ${toString cfg.hypridle.lockTimeout}
on-timeout = "hyprlock"
}
listener {
timeout = 660
timeout = ${toString cfg.hypridle.dpmsTimeout}
on-timeout = hyprctl dispatch dpms off
on-resume = hyprctl dispatch dpms on
}
listener {
timeout = 1800
timeout = ${toString cfg.hypridle.suspendTimeout}
on-timeout = systemctl suspend
}
'';

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib, config, ... }:
let
types = lib.types;
in
@ -49,6 +49,24 @@ in
};
};
hypridle = {
lockTimeout = lib.mkOption {
type = lib.types.int;
default = 600;
description = ''Time in seconds before the screen locks'';
};
dpmsTimeout = lib.mkOption {
type = lib.types.int;
default = config.profile.hyprland.hypridle.lockTimeout + 60;
description = ''Time in seconds before the screen turns off. default is lockTimeout + 60'';
};
suspendTimeout = lib.mkOption {
type = lib.types.int;
default = 1800;
description = ''Time in seconds before the system suspends. default is 30 minutes (1800 seconds)'';
};
};
dunst.monitor = lib.mkOption {
type = lib.types.str;
default = "0";