From 31ea32fa1465568e95ea1288ea1dd02689c77c5e Mon Sep 17 00:00:00 2001 From: octvs Date: Tue, 24 Feb 2026 19:03:46 +0100 Subject: [PATCH] i3-sway: allow inverse_outer on smart_gaps Change the boolean `smartGaps` option to an `enum` that expects common values of i3 and sway ("on" "off" "inverse_outer"). --- .../misc/news/2026/02/2026-02-24_19-17-29.nix | 9 +++++++++ .../window-managers/i3-sway/lib/functions.nix | 2 +- .../window-managers/i3-sway/lib/options.nix | 20 ++++++++++++++++--- 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 modules/misc/news/2026/02/2026-02-24_19-17-29.nix diff --git a/modules/misc/news/2026/02/2026-02-24_19-17-29.nix b/modules/misc/news/2026/02/2026-02-24_19-17-29.nix new file mode 100644 index 00000000..f2054991 --- /dev/null +++ b/modules/misc/news/2026/02/2026-02-24_19-17-29.nix @@ -0,0 +1,9 @@ +{ + time = "2026-02-24T18:17:29+00:00"; + condition = true; + message = '' + The options 'xsession.windowManager.i3.config.gaps.smartGaps' and + 'wayland.windowManager.sway.config.gaps.smartGaps' now expects either "on", + "off" (default) or "inverse_outer". + ''; +} diff --git a/modules/services/window-managers/i3-sway/lib/functions.nix b/modules/services/window-managers/i3-sway/lib/functions.nix index 2b8ecd7e..14880c4c 100644 --- a/modules/services/window-managers/i3-sway/lib/functions.nix +++ b/modules/services/window-managers/i3-sway/lib/functions.nix @@ -189,7 +189,7 @@ rec { (optionalString (bottom != null) "gaps bottom ${toString bottom}") (optionalString (left != null) "gaps left ${toString left}") (optionalString (right != null) "gaps right ${toString right}") - (optionalString smartGaps "smart_gaps on") + (optionalString (smartGaps != "off") "smart_gaps ${smartGaps}") (optionalString (smartBorders != "off") "smart_borders ${smartBorders}") ] ); diff --git a/modules/services/window-managers/i3-sway/lib/options.nix b/modules/services/window-managers/i3-sway/lib/options.nix index ce770c3c..ae69adfe 100644 --- a/modules/services/window-managers/i3-sway/lib/options.nix +++ b/modules/services/window-managers/i3-sway/lib/options.nix @@ -932,13 +932,27 @@ in }; smartGaps = mkOption { - type = types.bool; - default = false; + type = types.either types.bool ( + types.enum [ + "on" + "off" + "inverse_outer" + ] + ); + apply = + value: + if value == true then + "on" + else if value == false then + "off" + else + value; + default = "off"; description = '' This option controls whether to disable all gaps (outer and inner) on workspace with a single container. ''; - example = true; + example = "on"; }; smartBorders = mkOption {