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
|
@ -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