ark/users/modules/hyprland/swayidle.nix

33 lines
610 B
Nix
Raw Normal View History

2022-09-12 02:24:41 +03:00
{
pkgs,
lib,
...
}: {
home.packages = with pkgs; [wlopm swayidle];
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "swaylock";
}
{
event = "lock";
command = "swaylock";
}
];
timeouts = [
{
timeout = 120;
command = "wlopm --off \*";
resumeCommand = "wlopm --on \*";
}
{
timeout = 300;
command = "loginctl lock-session";
}
];
};
systemd.user.services.swayidle.Install.WantedBy = lib.mkForce ["hyprland-session.target"];
}