blob: 33cd4959840328983cbd69dfdc595692f4fc5dc7 (
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
26
27
28
29
|
{
config,
lib,
pkgs,
...
}:
{
options.swayidle.enable = lib.mkEnableOption "Enable swayidle configuration";
config = lib.mkIf config.swayidle.enable {
services.swayidle = {
enable = true;
timeouts = [
{
timout = "600";
command = "${pkgs.sway}/bin/swaymsg output * dpms off";
}
{
timout = "900";
command = "${pkgs.systemd}/bin/systemctl suspend";
}
];
events = [
{ event = "resume"; command = "${pkgs.sway}/bin/swaymsg output * dpms on"; }
{ event = "before-sleep"; command = "${pkgs.hyprlock}/bin/hyprlock"; }
];
};
};
}
|