hypridle: use home manager module for hypridle

This commit is contained in:
Tigor Hutasuhut 2024-10-20 10:46:40 +07:00
parent 0bfdafe9d9
commit 2e72b14d49

View file

@ -4,30 +4,30 @@ let
in in
{ {
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
home.packages = [ unstable.hypridle ]; services.hypridle = {
enable = true;
home.file.".config/hypr/hypridle.conf".text = /*hyprlang*/ '' settings = {
general { general = {
lock_cmd = "pidof hyprlock || hyprlock" lock_cmd = "pidof hyprlock || hyprlock";
before_sleep_cmd = "hyprlock" before_sleep_cmd = "loginctl lock-session";
after_sleep_cmd = hyprctl dispatch dpms on after_sleep_cmd = "hyprctl dispatch dpms on";
} };
listener = [
listener { {
timeout = ${toString cfg.hypridle.lockTimeout} timeout = cfg.hypridle.lockTimeout;
on-timeout = "hyprlock" on-timeout = "loginctl lock-session";
} }
{
listener { timeout = cfg.hypridle.dpmsTimeout;
timeout = ${toString cfg.hypridle.dpmsTimeout} on-timeout = "hyprctl dispatch dpms off";
on-timeout = hyprctl dispatch dpms off on-resume = "hyprctl dispatch dpms on";
on-resume = hyprctl dispatch dpms on }
} {
timeout = cfg.hypridle.suspendTimeout;
listener { on-timeout = "systemctl suspend";
timeout = ${toString cfg.hypridle.suspendTimeout} }
on-timeout = systemctl suspend ];
} };
''; };
}; };
} }