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