hypridle: use home manager module for hypridle
This commit is contained in:
parent
0bfdafe9d9
commit
2e72b14d49
|
@ -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
|
];
|
||||||
}
|
};
|
||||||
'';
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue