diff --git a/modules/sway/config.nix b/modules/sway/config.nix index 98fb9e845192673bbdee808d3899a4cd06bca80a..c11c6aff76254af58c5b05c9be409ff8d2aa04f8 100644 --- a/modules/sway/config.nix +++ b/modules/sway/config.nix @@ -129,7 +129,7 @@ bindsym Ctrl+Shift+Print exec grim -g "$(slurp)" # suspend bindsym $mod+Print exec systemctl suspend -exec swayidle -w before-sleep "swaylock -f -i $lockscreen" +${if cfg.autoLockBeforeSuspend then ''exec swayidle -w before-sleep "swaylock -f -i $lockscreen"'' else ""} # subraum #bindsym $mod+Delete exec ~/run/subraum/hackbuzzer diff --git a/modules/sway/default.nix b/modules/sway/default.nix index 025ceb7e54de33f76a69699a6dd2f66b2dfe099e..6b7f89699c9460e96b9e5fdfb61fc75d8a685926 100644 --- a/modules/sway/default.nix +++ b/modules/sway/default.nix @@ -15,7 +15,12 @@ in type = types.str; default = "jens"; }; + autoLockBeforeSuspend = mkOption { + type = types.bool; + default = true; + }; }; + }; config = mkIf cfg.enable { home-manager.users."${cfg.user}" = { pkgs, ... }: {