2023-12-07 06:26:40 +00:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
2023-12-07 06:49:38 +00:00
|
|
|
config,
|
2023-12-07 06:26:40 +00:00
|
|
|
...
|
|
|
|
}: {
|
2023-11-05 13:35:28 +00:00
|
|
|
imports = [
|
2023-11-28 05:40:22 +00:00
|
|
|
../swaylock
|
2023-11-05 13:35:28 +00:00
|
|
|
];
|
|
|
|
|
2023-12-07 06:49:38 +00:00
|
|
|
services.swayidle = let
|
|
|
|
lock = lib.getExe config.programs.swaylock.package;
|
2024-01-13 08:22:25 +00:00
|
|
|
brightness = lib.getExe pkgs.brightnessctl;
|
2023-12-07 06:49:38 +00:00
|
|
|
in {
|
|
|
|
enable = true;
|
|
|
|
timeouts = [
|
|
|
|
{
|
|
|
|
timeout = 60 * 9;
|
2024-02-17 15:10:08 +00:00
|
|
|
command = "${brightness} -s set 20%";
|
|
|
|
resumeCommand = "${brightness} -r";
|
2024-08-19 14:45:14 +00:00
|
|
|
}
|
2023-12-07 06:49:38 +00:00
|
|
|
{
|
|
|
|
timeout = 60 * 10;
|
|
|
|
command = "systemctl suspend";
|
2024-08-19 14:45:14 +00:00
|
|
|
}
|
2023-12-07 06:49:38 +00:00
|
|
|
];
|
|
|
|
events = [
|
|
|
|
{
|
|
|
|
event = "lock";
|
|
|
|
command = lock;
|
2024-08-19 14:45:14 +00:00
|
|
|
}
|
2023-12-07 06:49:38 +00:00
|
|
|
{
|
|
|
|
event = "before-sleep";
|
|
|
|
command = lock;
|
2024-08-19 14:45:14 +00:00
|
|
|
}
|
2023-12-07 06:49:38 +00:00
|
|
|
];
|
2023-11-05 12:50:08 +00:00
|
|
|
};
|
|
|
|
}
|