2026-04-17 12:47:51 +02:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
{
|
|
|
|
|
services.swayidle =
|
|
|
|
|
let
|
|
|
|
|
lock-command = "${pkgs.systemd}/bin/loginctl lock-session";
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
2026-05-27 19:21:09 +02:00
|
|
|
systemdTargets = [ "graphical-session.target" ];
|
2026-04-17 12:47:51 +02:00
|
|
|
timeouts = [
|
|
|
|
|
{
|
|
|
|
|
timeout = 30;
|
|
|
|
|
command = lock-command;
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
timeout = 60 * 10;
|
|
|
|
|
command = "${pkgs.systemd}/bin/systemctl suspend";
|
|
|
|
|
}
|
|
|
|
|
];
|
2026-05-27 19:21:09 +02:00
|
|
|
events = {
|
|
|
|
|
before-sleep = "${pkgs.playerctl}/bin/playerctl pause; ${lock-command}";
|
|
|
|
|
};
|
2026-04-17 12:47:51 +02:00
|
|
|
};
|
|
|
|
|
}
|