From f4779c6fd48bec7d0435d30a2b09777be5bdf88e Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Thu, 21 Nov 2024 18:38:51 +0100 Subject: [PATCH] home/programs/waybar: simplify conditional styling --- home/programs/waybar/style.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/home/programs/waybar/style.nix b/home/programs/waybar/style.nix index 66bb7ea..e86170b 100644 --- a/home/programs/waybar/style.nix +++ b/home/programs/waybar/style.nix @@ -4,17 +4,16 @@ ... }: let inherit (osConfig.theme.scheme) palette; - inherit (builtins) concatStringsSep; - inherit (lib) mapAttrsToList mkIf mkMerge; + inherit (lib) mapAttrsToList concatLines optionalString; - generateGtkColors = palette: (concatStringsSep "\n" + generateGtkColors = palette: (concatLines (mapAttrsToList (name: color: "@define-color ${name} ${color};") palette)); in { - programs.waybar.style = mkMerge [ - (mkIf osConfig.theme.enable generateGtkColors palette) - '' + programs.waybar.style = + optionalString osConfig.theme.enable generateGtkColors palette + + '' * { /* `otf-font-awesome` is required to be installed for icons */ border: none; @@ -102,6 +101,5 @@ in { padding: 0 1.2em; color: @base08; } - '' - ]; + ''; }