mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
polybar: enclose strings in double quotes
This fixes the case when there are trailing spaces in string values which can be used for elements padding.
This commit is contained in:
parent
469caa1a14
commit
9eb48312c7
1 changed files with 12 additions and 1 deletions
|
@ -7,8 +7,19 @@ let
|
|||
|
||||
cfg = config.services.polybar;
|
||||
|
||||
toPolybarIni = generators.toINI {
|
||||
mkKeyValue = key: value:
|
||||
let
|
||||
value' =
|
||||
if isBool value then (if value then "true" else "false")
|
||||
else if isString value then "\"${value}\""
|
||||
else toString value;
|
||||
in
|
||||
"${key}=${value'}";
|
||||
};
|
||||
|
||||
configFile = pkgs.writeText "polybar.conf"
|
||||
(generators.toINI {} cfg.config + "\n" + cfg.extraConfig);
|
||||
(toPolybarIni cfg.config + "\n" + cfg.extraConfig);
|
||||
|
||||
script = ''
|
||||
#!${pkgs.stdenv.shell}
|
||||
|
|
Loading…
Reference in a new issue