2023-11-05 12:50:08 +00:00
|
|
|
{pkgs, ...}: {
|
2023-11-05 13:35:28 +00:00
|
|
|
imports = [
|
|
|
|
./swaylock.nix
|
|
|
|
];
|
|
|
|
|
2023-11-05 12:50:08 +00:00
|
|
|
services = {
|
2023-11-05 13:35:28 +00:00
|
|
|
swayidle = {
|
2023-11-05 12:50:08 +00:00
|
|
|
enable = true;
|
|
|
|
timeouts = [
|
|
|
|
{
|
|
|
|
timeout = 900;
|
2023-11-07 10:16:47 +00:00
|
|
|
command = "swaylock";
|
2023-11-05 12:50:08 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
timeout = 905;
|
|
|
|
command = ''${pkgs.sway}/bin/swaymsg "output * dpms off"'';
|
|
|
|
resumeCommand = ''${pkgs.sway}/bin/swaymsg "output * dpms on"'';
|
|
|
|
} # turn off screen
|
|
|
|
];
|
|
|
|
events = [
|
|
|
|
{
|
|
|
|
event = "lock";
|
2023-11-05 13:35:28 +00:00
|
|
|
command = "swaylock";
|
2023-11-05 12:50:08 +00:00
|
|
|
} # loginctl lock-session
|
|
|
|
{
|
|
|
|
event = "before-sleep";
|
2023-11-05 13:35:28 +00:00
|
|
|
command = "swaylock";
|
2023-11-05 12:50:08 +00:00
|
|
|
} # systemctl syspend
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|