polybar: single-quote instead of double
Polybar expects quoted values only when whitespace is important to the value Fixes #356
This commit is contained in:
parent
ecc12d5b41
commit
3551a105d5
|
@ -10,10 +10,15 @@ let
|
||||||
|
|
||||||
toPolybarIni = generators.toINI {
|
toPolybarIni = generators.toINI {
|
||||||
mkKeyValue = key: value:
|
mkKeyValue = key: value:
|
||||||
let
|
let
|
||||||
|
quoted = v:
|
||||||
|
if hasPrefix " " v || hasSuffix " " v
|
||||||
|
then ''"${v}"''
|
||||||
|
else v;
|
||||||
|
|
||||||
value' =
|
value' =
|
||||||
if isBool value then (if value then "true" else "false")
|
if isBool value then (if value then "true" else "false")
|
||||||
else if (isString value && key != "include-file") then ''${value}''
|
else if (isString value && key != "include-file") then quoted value
|
||||||
else toString value;
|
else toString value;
|
||||||
in
|
in
|
||||||
"${key}=${value'}";
|
"${key}=${value'}";
|
||||||
|
|
Loading…
Reference in a new issue