home/swayidle: fix not suspending
This commit is contained in:
parent
5852b1cabd
commit
22dbe7b96b
1 changed files with 19 additions and 29 deletions
|
@ -9,32 +9,22 @@
|
|||
../swaylock
|
||||
];
|
||||
|
||||
services.swayidle =
|
||||
let
|
||||
lock = lib.getExe config.programs.swaylock.package;
|
||||
brightness = lib.getExe pkgs.brightnessctl;
|
||||
in
|
||||
{
|
||||
services.swayidle = {
|
||||
enable = true;
|
||||
timeouts = [
|
||||
{
|
||||
timeout = 60 * 9;
|
||||
command = "${brightness} -s set 20%";
|
||||
resumeCommand = "${brightness} -r";
|
||||
}
|
||||
{
|
||||
timeout = 60 * 10;
|
||||
command = "systemctl suspend";
|
||||
command = "/run/current-system/sw/bin/systemctl suspend";
|
||||
}
|
||||
];
|
||||
events = [
|
||||
{
|
||||
event = "lock";
|
||||
command = lock;
|
||||
command = lib.getExe config.programs.swaylock.package;
|
||||
}
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = lock;
|
||||
command = "/run/current-system/systemd/bin/loginctl lock-session";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue