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