aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCole Mickens <cole.mickens@gmail.com>2020-05-11 14:56:40 -0700
committerRobert Helgesson <robert@rycee.net>2020-07-17 15:35:00 +0200
commit5c639ff68abf0f16f2e63fb3f8aca016d54c7d10 (patch)
tree4343157909ee81148eed56a731fb6d851155dc80 /modules
parenta49ce0e9edcd717ce6e66041aabd656c02903904 (diff)
sway: focus.followMouse supports yes/no/always
Also add associated tests for both Sway and i3. PR #1231
Diffstat (limited to 'modules')
-rw-r--r--modules/services/window-managers/i3-sway/lib/options.nix12
-rw-r--r--modules/services/window-managers/i3-sway/sway.nix2
2 files changed, 11 insertions, 3 deletions
diff --git a/modules/services/window-managers/i3-sway/lib/options.nix b/modules/services/window-managers/i3-sway/lib/options.nix
index 2d483bfd76b..b5216f8ca1c 100644
--- a/modules/services/window-managers/i3-sway/lib/options.nix
+++ b/modules/services/window-managers/i3-sway/lib/options.nix
@@ -390,9 +390,17 @@ in {
};
followMouse = mkOption {
- type = types.bool;
- default = true;
+ type = if moduleName == "sway" then
+ types.either (types.enum [ "yes" "no" "always" ]) types.bool
+ else
+ types.bool;
+ default = if moduleName == "sway" then "yes" else true;
description = "Whether focus should follow the mouse.";
+ apply = val:
+ if (moduleName == "sway" && isBool val) then
+ (if val then "yes" else "no")
+ else
+ val;
};
forceWrapping = mkOption {
diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix
index 0445e46e2d2..83c8afd6c46 100644
--- a/modules/services/window-managers/i3-sway/sway.nix
+++ b/modules/services/window-managers/i3-sway/sway.nix
@@ -253,7 +253,7 @@ let
} ${toString floating.border}
hide_edge_borders ${window.hideEdgeBorders}
focus_wrapping ${if focus.forceWrapping then "yes" else "no"}
- focus_follows_mouse ${if focus.followMouse then "yes" else "no"}
+ focus_follows_mouse ${focus.followMouse}
focus_on_window_activation ${focus.newWindow}
mouse_warping ${if focus.mouseWarping then "output" else "none"}
workspace_layout ${workspaceLayout}