From 3551a105d5eb6b1417668ca423efd5e19cf79d57 Mon Sep 17 00:00:00 2001 From: Jonathan Reeve Date: Tue, 28 Aug 2018 10:19:13 -0400 Subject: [PATCH] polybar: single-quote instead of double Polybar expects quoted values only when whitespace is important to the value Fixes #356 --- modules/services/polybar.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/services/polybar.nix b/modules/services/polybar.nix index da2c21fc..3bdc836e 100644 --- a/modules/services/polybar.nix +++ b/modules/services/polybar.nix @@ -10,10 +10,15 @@ let toPolybarIni = generators.toINI { mkKeyValue = key: value: - let + let + quoted = v: + if hasPrefix " " v || hasSuffix " " v + then ''"${v}"'' + else v; + value' = 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; in "${key}=${value'}";