1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59: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:
Nikita Uvarov 2017-10-09 14:21:43 +02:00
parent 469caa1a14
commit 9eb48312c7
No known key found for this signature in database
GPG key ID: F7A5FB3A7C10EF96

View file

@ -7,8 +7,19 @@ let
cfg = config.services.polybar; 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" configFile = pkgs.writeText "polybar.conf"
(generators.toINI {} cfg.config + "\n" + cfg.extraConfig); (toPolybarIni cfg.config + "\n" + cfg.extraConfig);
script = '' script = ''
#!${pkgs.stdenv.shell} #!${pkgs.stdenv.shell}