From 68eaf4b577cfa8024fb910a1ce7d60385044f798 Mon Sep 17 00:00:00 2001 From: Basti Date: Sun, 16 Apr 2023 23:34:29 +0000 Subject: [PATCH] i3-sway: add option trayPadding (tray_padding) for bars (#3829) --- .../services/window-managers/i3-sway/lib/functions.nix | 6 ++++-- modules/services/window-managers/i3-sway/lib/options.nix | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/services/window-managers/i3-sway/lib/functions.nix b/modules/services/window-managers/i3-sway/lib/functions.nix index c6a6ada15..4395f38b7 100644 --- a/modules/services/window-managers/i3-sway/lib/functions.nix +++ b/modules/services/window-managers/i3-sway/lib/functions.nix @@ -69,8 +69,8 @@ rec { }; barStr = { id, fonts, mode, hiddenState, position, workspaceButtons - , workspaceNumbers, command, statusCommand, colors, trayOutput, extraConfig - , ... }: + , workspaceNumbers, command, statusCommand, colors, trayOutput, trayPadding + , extraConfig, ... }: let colorsNotNull = lib.filterAttrs (n: v: v != null) colors != { }; in '' bar { @@ -93,6 +93,8 @@ rec { lib.hm.booleans.yesNo (!workspaceNumbers) }") (optionalString (trayOutput != null) "tray_output ${trayOutput}") + (optionalString (trayPadding != null) + "tray_padding ${toString trayPadding}") (optionals colorsNotNull (indent (lists.subtractLists [ "" null ] [ "colors {" diff --git a/modules/services/window-managers/i3-sway/lib/options.nix b/modules/services/window-managers/i3-sway/lib/options.nix index 3fe0b7551..0cbea6428 100644 --- a/modules/services/window-managers/i3-sway/lib/options.nix +++ b/modules/services/window-managers/i3-sway/lib/options.nix @@ -293,6 +293,15 @@ let default = "primary"; description = "Where to output tray."; }; + + trayPadding = mkNullableOption { + type = types.int; + default = null; + description = '' + Sets the pixel padding of the system tray. + This padding will surround the tray on all sides and between each item. + ''; + }; }; };