nix-da/home/sway/swayidle.nix
2024-05-16 03:58:46 +09:00

26 lines
494 B
Nix

{ pkgs, ... }:
{
services.swayidle = {
enable = true;
events = [
{
event = "before-sleep";
command = "${pkgs.swaylock}/bin/swaylock";
}
{
event = "lock";
command = "${pkgs.swaylock}/bin/swaylock";
}
];
timeouts = [
{
timeout = 300;
command = "${pkgs.swaylock}/bin/swaylock";
}
{
timeout = 1200;
command = "${pkgs.systemd}/bin/systemctl hibernate";
}
];
};
}