1
1
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-10-05 17:07:29 +03: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 != {})
then "${toYabaiConfig cfg.config}"
else "")
+ optionalString (cfg.extraConfig != "") cfg.extraConfig)}";
+ optionalString (cfg.extraConfig != "") ("\n" + cfg.extraConfig + "\n"))}";
in
{

View File

@ -23,5 +23,6 @@ in
echo >&2 "checking config in $conf"
grep "yabai -m config focus_follows_mouse autoraise" $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
'';
}