feat: implement hyprlock and hypridle

This commit is contained in:
Nickolaj Jepsen 2025-04-15 23:48:15 +02:00
parent 870f8fdde5
commit 0d47ab58f5
4 changed files with 146 additions and 8 deletions

View file

@ -0,0 +1,34 @@
{
config,
pkgs,
...
}:
let
sleep_cmd = "${config.programs.hyprland.package}/bin/hyprctl dispatch dpms off";
wake_cmd = "${config.programs.hyprland.package}/bin/hyprctl dispatch dpms on";
lock_cmd = "pidof ${pkgs.hyprlock}/bin/hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
in {
config = {
fireproof.home-manager.services.hypridle = {
enable = true;
settings = {
general = {
inherit lock_cmd;
before_sleep_cmd = "${pkgs.systemd}/bin/loginctl lock-session";
after_sleep_cmd = sleep_cmd;
};
listener = [
{
timeout = 60 * 5;
on-timeout = lock_cmd;
}
{
timeout = 60 * 15;
on-timeout = sleep_cmd;
on-resume = wake_cmd;
}
];
};
};
};
}