1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-15 17:50:53 +00:00

i3-sway: config.focus.wrapping deprecates forceWrapping (#3467)

Stop using the legacy syntax described in the i3 documentation:
https://i3wm.org/docs/userguide.html#_focus_wrapping
This commit is contained in:
arcnmx 2023-01-15 10:20:13 -08:00 committed by GitHub
parent 2827b53064
commit d633afe0d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 38 additions and 21 deletions

View file

@ -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.")
];
})
]);
}

View file

@ -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 <link xlink:href="https://i3wm.org/docs/userguide.html#_focus_wrapping"/>
'';
};
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 <link xlink:href="https://i3wm.org/docs/userguide.html#_focus_wrapping"/>
This option is deprecated, use <option>focus.wrapping</option> instead.
'';
};

View file

@ -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.")
];
})
{

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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