1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00

xresources: do not generate file for empty properties

This commit is contained in:
Robert Helgesson 2020-06-28 00:41:05 +02:00
parent a94c8b072e
commit 600f39f966
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 17 additions and 13 deletions

View file

@ -75,17 +75,18 @@ in {
};
};
config = mkIf (cfg.properties != null || cfg.extraConfig != "") {
home.file.".Xresources" = {
text = concatStringsSep "\n" ([ ]
++ optional (cfg.extraConfig != "") cfg.extraConfig
++ optionals (cfg.properties != null)
(mapAttrsToList formatLine cfg.properties)) + "\n";
onChange = ''
if [[ -v DISPLAY ]] ; then
$DRY_RUN_CMD ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.Xresources
fi
'';
config = mkIf ((cfg.properties != null && cfg.properties != { })
|| cfg.extraConfig != "") {
home.file.".Xresources" = {
text = concatStringsSep "\n" ([ ]
++ optional (cfg.extraConfig != "") cfg.extraConfig
++ optionals (cfg.properties != null)
(mapAttrsToList formatLine cfg.properties)) + "\n";
onChange = ''
if [[ -v DISPLAY ]] ; then
$DRY_RUN_CMD ${pkgs.xorg.xrdb}/bin/xrdb -merge $HOME/.Xresources
fi
'';
};
};
};
}

View file

@ -1 +1,4 @@
{ xresources = ./xresources.nix; }
{
xresources = ./xresources.nix;
xresources-empty-properties = ./empty.nix;
}