home/programs/waybar: simplify conditional styling
This commit is contained in:
parent
90ba974f1c
commit
f4779c6fd4
1 changed files with 6 additions and 8 deletions
|
@ -4,17 +4,16 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (osConfig.theme.scheme) palette;
|
inherit (osConfig.theme.scheme) palette;
|
||||||
inherit (builtins) concatStringsSep;
|
inherit (lib) mapAttrsToList concatLines optionalString;
|
||||||
inherit (lib) mapAttrsToList mkIf mkMerge;
|
|
||||||
|
|
||||||
generateGtkColors = palette: (concatStringsSep "\n"
|
generateGtkColors = palette: (concatLines
|
||||||
(mapAttrsToList
|
(mapAttrsToList
|
||||||
(name: color: "@define-color ${name} ${color};")
|
(name: color: "@define-color ${name} ${color};")
|
||||||
palette));
|
palette));
|
||||||
in {
|
in {
|
||||||
programs.waybar.style = mkMerge [
|
programs.waybar.style =
|
||||||
(mkIf osConfig.theme.enable generateGtkColors palette)
|
optionalString osConfig.theme.enable generateGtkColors palette
|
||||||
''
|
+ ''
|
||||||
* {
|
* {
|
||||||
/* `otf-font-awesome` is required to be installed for icons */
|
/* `otf-font-awesome` is required to be installed for icons */
|
||||||
border: none;
|
border: none;
|
||||||
|
@ -102,6 +101,5 @@ in {
|
||||||
padding: 0 1.2em;
|
padding: 0 1.2em;
|
||||||
color: @base08;
|
color: @base08;
|
||||||
}
|
}
|
||||||
''
|
'';
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue