swayidle: output on/off, suspend

This commit is contained in:
Casper V. Kristensen 2023-08-26 21:25:38 +02:00
parent 785790bc0b
commit 32a644dd5c

View file

@ -199,6 +199,9 @@
services.swayidle = services.swayidle =
let let
lock = "${pkgs.swaylock}/bin/swaylock --daemonize"; lock = "${pkgs.swaylock}/bin/swaylock --daemonize";
outputOff = "${pkgs.sway}/bin/swaymsg 'output * power off'";
outputOn = "${pkgs.sway}/bin/swaymsg 'output * power on'";
suspend = "${pkgs.systemd}/bin/systemctl suspend";
in in
{ {
enable = true; enable = true;
@ -208,6 +211,8 @@
]; ];
timeouts = [ timeouts = [
{ timeout = 600; command = lock; } { timeout = 600; command = lock; }
{ timeout = 900; command = outputOff; resumeCommand = outputOn; }
{ timeout = 3600; command = suspend; }
]; ];
}; };
}; };