Skip to content

Commit

Permalink
kanshi: dont write config if unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
teto committed Dec 11, 2024
1 parent 6e5b2d9 commit 3d49b8d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/services/kanshi.nix
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,13 @@ in {
{
home.packages = [ cfg.package ];

xdg.configFile."kanshi/config".text =
if cfg.profiles == { } && cfg.extraConfig == "" then
directivesStr
else
oldDirectivesStr;
xdg.configFile."kanshi/config" = let
generatedConfigStr =
if cfg.profiles == { } && cfg.extraConfig == "" then
directivesStr
else
oldDirectivesStr;
in mkIf (generatedConfigStr != "") { text = generatedConfigStr; };

systemd.user.services.kanshi = {
Unit = {
Expand Down

0 comments on commit 3d49b8d

Please sign in to comment.