diff options
Diffstat (limited to 'modules/home-manager/swayidle.nix')
| -rw-r--r-- | modules/home-manager/swayidle.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/home-manager/swayidle.nix b/modules/home-manager/swayidle.nix new file mode 100644 index 0000000..33cd495 --- /dev/null +++ b/modules/home-manager/swayidle.nix @@ -0,0 +1,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"; } + ]; + }; + }; +} |
