diff --git a/modules/services/window-managers/i3-sway/i3.nix b/modules/services/window-managers/i3-sway/i3.nix
index f28b9b67..b4742c78 100644
--- a/modules/services/window-managers/i3-sway/i3.nix
+++ b/modules/services/window-managers/i3-sway/i3.nix
@@ -160,7 +160,7 @@ let
"floating_modifier ${floating.modifier}"
(windowBorderString window floating)
"hide_edge_borders ${window.hideEdgeBorders}"
- "force_focus_wrapping ${lib.hm.booleans.yesNo focus.forceWrapping}"
+ "focus_wrapping ${focus.wrapping}"
"focus_follows_mouse ${lib.hm.booleans.yesNo focus.followMouse}"
"focus_on_window_activation ${focus.newWindow}"
"mouse_warping ${if focus.mouseWarping then "output" else "none"}"
@@ -256,16 +256,15 @@ in {
++ flatten (map (b:
optional (isList b.fonts)
"Specifying i3.config.bars[].fonts as a list is deprecated. Use the attrset version instead.")
- cfg.config.bars);
+ cfg.config.bars) ++ [
+ (mkIf (any (s: s.workspace != null) cfg.config.startup)
+ ("'xsession.windowManager.i3.config.startup.*.workspace' is deprecated, "
+ + "use 'xsession.windowManager.i3.config.assigns' instead."
+ + "See https://github.com/nix-community/home-manager/issues/265."))
+ (mkIf cfg.config.focus.forceWrapping
+ ("'xsession.windowManager.i3.config.focus.forceWrapping' is deprecated, "
+ + "use 'xsession.windowManager.i3.config.focus.wrapping' instead."))
+ ];
})
-
- (mkIf (cfg.config != null
- && (any (s: s.workspace != null) cfg.config.startup)) {
- warnings = [
- ("'xsession.windowManager.i3.config.startup.*.workspace' is deprecated, "
- + "use 'xsession.windowManager.i3.config.assigns' instead."
- + "See https://github.com/nix-community/home-manager/issues/265.")
- ];
- })
]);
}
diff --git a/modules/services/window-managers/i3-sway/lib/options.nix b/modules/services/window-managers/i3-sway/lib/options.nix
index d04a1176..3fe0b755 100644
--- a/modules/services/window-managers/i3-sway/lib/options.nix
+++ b/modules/services/window-managers/i3-sway/lib/options.nix
@@ -510,13 +510,28 @@ in {
if (isSway && isBool val) then (lib.hm.booleans.yesNo val) else val;
};
+ wrapping = mkOption {
+ type = types.enum [ "yes" "no" "force" "workspace" ];
+ default = {
+ i3 = if cfg.config.focus.forceWrapping then "force" else "yes";
+ # the sway module's logic was inverted and incorrect,
+ # so preserve it for backwards compatibility purposes
+ sway = if cfg.config.focus.forceWrapping then "yes" else "no";
+ }.${moduleName};
+ description = ''
+ Whether the window focus commands automatically wrap around the edge of containers.
+
+ See
+ '';
+ };
+
forceWrapping = mkOption {
type = types.bool;
default = false;
description = ''
- Whether to force focus wrapping in tabbed or stacked container.
+ Whether to force focus wrapping in tabbed or stacked containers.
- See
+ This option is deprecated, use instead.
'';
};
diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix
index fdcbaabc..a18a4212 100644
--- a/modules/services/window-managers/i3-sway/sway.nix
+++ b/modules/services/window-managers/i3-sway/sway.nix
@@ -271,7 +271,7 @@ let
"floating_modifier ${floating.modifier}"
(windowBorderString window floating)
"hide_edge_borders ${window.hideEdgeBorders}"
- "focus_wrapping ${lib.hm.booleans.yesNo focus.forceWrapping}"
+ "focus_wrapping ${focus.wrapping}"
"focus_follows_mouse ${focus.followMouse}"
"focus_on_window_activation ${focus.newWindow}"
"mouse_warping ${
@@ -442,7 +442,10 @@ in {
++ flatten (map (b:
optional (isList b.fonts)
"Specifying sway.config.bars[].fonts as a list is deprecated. Use the attrset version instead.")
- cfg.config.bars);
+ cfg.config.bars) ++ [
+ (mkIf cfg.config.focus.forceWrapping
+ "sway.config.focus.forceWrapping is deprecated, use focus.wrapping instead.")
+ ];
})
{
diff --git a/tests/modules/services/window-managers/i3/i3-bar-focused-colors-expected.conf b/tests/modules/services/window-managers/i3/i3-bar-focused-colors-expected.conf
index 92f23a92..3b8fca8a 100644
--- a/tests/modules/services/window-managers/i3/i3-bar-focused-colors-expected.conf
+++ b/tests/modules/services/window-managers/i3/i3-bar-focused-colors-expected.conf
@@ -3,7 +3,7 @@ floating_modifier Mod1
default_border normal 2
default_floating_border normal 2
hide_edge_borders none
-force_focus_wrapping no
+focus_wrapping yes
focus_follows_mouse yes
focus_on_window_activation smart
mouse_warping output
diff --git a/tests/modules/services/window-managers/i3/i3-followmouse-expected.conf b/tests/modules/services/window-managers/i3/i3-followmouse-expected.conf
index 27234b96..dccf535a 100644
--- a/tests/modules/services/window-managers/i3/i3-followmouse-expected.conf
+++ b/tests/modules/services/window-managers/i3/i3-followmouse-expected.conf
@@ -3,7 +3,7 @@ floating_modifier Mod1
default_border normal 2
default_floating_border normal 2
hide_edge_borders none
-force_focus_wrapping no
+focus_wrapping yes
focus_follows_mouse no
focus_on_window_activation smart
mouse_warping output
diff --git a/tests/modules/services/window-managers/i3/i3-fonts-expected.conf b/tests/modules/services/window-managers/i3/i3-fonts-expected.conf
index d85d978e..8e8cb9da 100644
--- a/tests/modules/services/window-managers/i3/i3-fonts-expected.conf
+++ b/tests/modules/services/window-managers/i3/i3-fonts-expected.conf
@@ -3,7 +3,7 @@ floating_modifier Mod1
default_border normal 2
default_floating_border normal 2
hide_edge_borders none
-force_focus_wrapping no
+focus_wrapping yes
focus_follows_mouse yes
focus_on_window_activation smart
mouse_warping output
diff --git a/tests/modules/services/window-managers/i3/i3-keybindings-expected.conf b/tests/modules/services/window-managers/i3/i3-keybindings-expected.conf
index b3b4c33d..2b7251d2 100644
--- a/tests/modules/services/window-managers/i3/i3-keybindings-expected.conf
+++ b/tests/modules/services/window-managers/i3/i3-keybindings-expected.conf
@@ -3,7 +3,7 @@ floating_modifier Mod1
default_border normal 2
default_floating_border normal 2
hide_edge_borders none
-force_focus_wrapping no
+focus_wrapping yes
focus_follows_mouse yes
focus_on_window_activation smart
mouse_warping output
diff --git a/tests/modules/services/window-managers/i3/i3-workspace-default-expected.conf b/tests/modules/services/window-managers/i3/i3-workspace-default-expected.conf
index d7fe4b61..baca1411 100644
--- a/tests/modules/services/window-managers/i3/i3-workspace-default-expected.conf
+++ b/tests/modules/services/window-managers/i3/i3-workspace-default-expected.conf
@@ -3,7 +3,7 @@ floating_modifier Mod1
default_border normal 2
default_floating_border normal 2
hide_edge_borders none
-force_focus_wrapping no
+focus_wrapping yes
focus_follows_mouse yes
focus_on_window_activation smart
mouse_warping output
diff --git a/tests/modules/services/window-managers/i3/i3-workspace-output-expected.conf b/tests/modules/services/window-managers/i3/i3-workspace-output-expected.conf
index dedad29e..a51edb9a 100644
--- a/tests/modules/services/window-managers/i3/i3-workspace-output-expected.conf
+++ b/tests/modules/services/window-managers/i3/i3-workspace-output-expected.conf
@@ -3,7 +3,7 @@ floating_modifier Mod1
default_border normal 2
default_floating_border normal 2
hide_edge_borders none
-force_focus_wrapping no
+focus_wrapping yes
focus_follows_mouse yes
focus_on_window_activation smart
mouse_warping output