35 lines
749 B
Nix
35 lines
749 B
Nix
{ config, pkgs, ... }:
|
|
|
|
{
|
|
services.hypridle = let
|
|
lock_cmd = "hyprlock --grace 10";
|
|
# lock_cmd = "exit";
|
|
suspend_cmd = "systemctl suspend || loginctl suspend";
|
|
in {
|
|
enable = true;
|
|
settings = {
|
|
general = {
|
|
lock_cmd = lock_cmd;
|
|
before_sleep_cmd = "loginctl lock-session";
|
|
inhibit_sleep = 3;
|
|
};
|
|
|
|
listener = [
|
|
{
|
|
timeout = 300; # 5 mins
|
|
on-timeout = "loginctl lock-session";
|
|
}
|
|
{
|
|
timeout = 600; # 10 mins
|
|
# on-timeout = "hyprctl dispatch dpms off";
|
|
# on-resume = "hyprctl dispatch dpms on";
|
|
}
|
|
{
|
|
timeout = 900; # 15 mins
|
|
on-timeout = suspend_cmd;
|
|
}
|
|
];
|
|
};
|
|
};
|
|
}
|