From face4094d499c84c782873464794cb976c94f079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Camille=20Favier?= Date: Thu, 7 Jul 2022 05:36:20 +0200 Subject: [PATCH] bspwm: add missing rule setting `rectangle` (#2974) Also add a `freeformType` so that we don't have to do this in the future. --- .../services/window-managers/bspwm/options.nix | 16 +++++++++++++--- .../services/window-managers/bspwm/bspwmrc | 2 +- .../window-managers/bspwm/configuration.nix | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/modules/services/window-managers/bspwm/options.nix b/modules/services/window-managers/bspwm/options.nix index 57a1d874a..441b49682 100644 --- a/modules/services/window-managers/bspwm/options.nix +++ b/modules/services/window-managers/bspwm/options.nix @@ -4,7 +4,11 @@ with lib; let + primitive = with types; oneOf [ bool int float str ]; + rule = types.submodule { + freeformType = with types; attrsOf primitive; + options = { monitor = mkOption { type = types.nullOr types.str; @@ -139,6 +143,14 @@ let description = "Whether the node should have border."; example = true; }; + + rectangle = mkOption { + type = types.nullOr types.str; + default = null; + description = + "The node's geometry, in the format WxH+X+Y."; + example = "800x600+32+32"; + }; }; }; @@ -155,9 +167,7 @@ in { }; settings = mkOption { - type = with types; - let primitive = either bool (either int (either float str)); - in attrsOf (either primitive (listOf primitive)); + type = with types; attrsOf (either primitive (listOf primitive)); default = { }; description = "General settings given to bspc config."; example = { diff --git a/tests/modules/services/window-managers/bspwm/bspwmrc b/tests/modules/services/window-managers/bspwm/bspwmrc index ba0da830a..2f669b830 100755 --- a/tests/modules/services/window-managers/bspwm/bspwmrc +++ b/tests/modules/services/window-managers/bspwm/bspwmrc @@ -9,7 +9,7 @@ bspc config 'ignore_ewmh_fullscreen' 'enter,exit' bspc config 'split_ratio' '0.520000' bspc rule -r '*' -bspc rule -a '*' 'center=off' 'desktop=d'\''esk top#next' 'split_dir=north' 'sticky=on' +bspc rule -a '*' 'center=off' 'desktop=d'\''esk top#next' 'split_dir=north' 'sticky=on' 'unknown_rule=42' # java gui fixes export _JAVA_AWT_WM_NONREPARENTING=1 diff --git a/tests/modules/services/window-managers/bspwm/configuration.nix b/tests/modules/services/window-managers/bspwm/configuration.nix index e4aec0f6c..577645bfa 100644 --- a/tests/modules/services/window-managers/bspwm/configuration.nix +++ b/tests/modules/services/window-managers/bspwm/configuration.nix @@ -22,6 +22,7 @@ with lib; desktop = "d'esk top#next"; splitDir = "north"; border = null; + unknownRule = 42; }; extraConfig = '' extra config