summaryrefslogtreecommitdiff
path: root/home/desktops/sway/idle.nix
blob: 1af4a6ad3127d0f586907df02a3c7d0550fbccb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{config, ...}: {
  services.swayidle = {
    enable = config.desktops.sway.enable;
    systemdTarget = "sway-session.target";

    timeouts = [
      {
        timeout = 300;
        command = "${config.default.lockScreen}";
      }
      {
        timeout = 300;
        command = "swaymsg \"output * power off\"";
        resumeCommand = "swaymsg \"output * power on\"";
      }
    ];

    events = [
      {
        event = "before-sleep";
        command = "${config.default.lockScreen}";
      }
    ];
  };
}