Don't set background to black if ~/.background-image not prese… (#78346)

Don't set background to black if ~/.background-image not present
This commit is contained in:
Silvan Mosberger 2020-01-28 16:42:44 +01:00 committed by GitHub
commit 766b78841f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,21 +68,15 @@ in
scripts before forwarding the value to the scripts before forwarding the value to the
<varname>displayManager</varname>. <varname>displayManager</varname>.
''; '';
apply = list: { apply = map (d: d // {
list = map (d: d // { manage = "desktop";
manage = "desktop"; start = d.start
start = d.start + optionalString (needBGCond d) ''
+ optionalString (needBGCond d) '' if [ -e $HOME/.background-image ]; then
if [ -e $HOME/.background-image ]; then ${pkgs.feh}/bin/feh --bg-${cfg.wallpaper.mode} ${optionalString cfg.wallpaper.combineScreens "--no-xinerama"} $HOME/.background-image
${pkgs.feh}/bin/feh --bg-${cfg.wallpaper.mode} ${optionalString cfg.wallpaper.combineScreens "--no-xinerama"} $HOME/.background-image fi
else '';
# Use a solid black background as fallback });
${pkgs.xorg.xsetroot}/bin/xsetroot -solid black
fi
'';
}) list;
needBGPackages = [] != filter needBGCond list;
};
}; };
default = mkOption { default = mkOption {
@ -100,5 +94,5 @@ in
}; };
config.services.xserver.displayManager.session = cfg.session.list; config.services.xserver.displayManager.session = cfg.session;
} }