nix-da/home/graphical/swayidle.nix

34 lines
589 B
Nix

{
pkgs,
lib,
config,
...
}:
lib.mkIf config.services.swayidle.enable {
services.swayidle =
let
locker = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock";
in
{
events = [
{
event = "before-sleep";
command = locker;
}
{
event = "lock";
command = locker;
}
];
timeouts = [
{
timeout = 300;
command = locker;
}
{
timeout = 1200;
command = "${pkgs.systemd}/bin/systemctl hibernate";
}
];
};
}