greenhouse

kore

my public infrastructure monorepo

git clone [email protected]:kore.git

kore / home / features / wayland / swayidle.nix24 lines · 442B · raw

1{ config, lib, pkgs, ... }:
2
3let
4  lock = "${lib.getExe config.programs.swaylock.package} -f";
5  wlopm = lib.getExe pkgs.wlopm;
6in {
7  services.swayidle = {
8    enable = true;
9
10    timeouts = [
11      { timeout = 600; command = lock; }
12      {
13        timeout = 900;
14        command = "${wlopm} --off '*'";
15        resumeCommand = "${wlopm} --on '*'";
16      }
17    ];
18
19    events = {
20      before-sleep = lock;
21      lock = lock;
22    };
23  };
24}