1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Separate yabai config and extra config by newline

If a user passes both `config` and `extraConfig` to the `yabai` serivce,
the generated `yabairc` file is invalid. This is because we do not add a
newline separator when we concatenate the config string generated by
`toYabaiConfig cfg.config` with `cfg.extraConfig`.

This PR prepends a newline to `cfg.extraConfig` if it is non-empty so
that the resulting `yabairc` config is valid.
This commit is contained in:
Shardul Baral 2020-05-15 14:40:50 -04:00
parent 5f6d300a2d
commit 97729d1e79
No known key found for this signature in database
GPG key ID: 6870F0700E69E9E6
2 changed files with 2 additions and 1 deletions

View file

@ -14,7 +14,7 @@ let
(if (cfg.config != {}) (if (cfg.config != {})
then "${toYabaiConfig cfg.config}" then "${toYabaiConfig cfg.config}"
else "") else "")
+ optionalString (cfg.extraConfig != "") cfg.extraConfig)}"; + optionalString (cfg.extraConfig != "") ("\n" + cfg.extraConfig + "\n"))}";
in in
{ {

View file

@ -23,5 +23,6 @@ in
echo >&2 "checking config in $conf" echo >&2 "checking config in $conf"
grep "yabai -m config focus_follows_mouse autoraise" $conf grep "yabai -m config focus_follows_mouse autoraise" $conf
grep "yabai -m rule --add app='System Preferences' manage=off" $conf grep "yabai -m rule --add app='System Preferences' manage=off" $conf
if [ `cat $conf | wc -l` -eq "2" ]; then echo "yabairc correctly contains 2 lines"; else return 1; fi
''; '';
} }