2023-06-11 23:26:28 +02:00
|
|
|
{
|
2024-03-02 22:05:30 +01:00
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit
|
|
|
|
(lib)
|
|
|
|
singleton
|
|
|
|
getExe
|
|
|
|
;
|
|
|
|
in {
|
2023-06-11 23:26:28 +02:00
|
|
|
systemd.user.services.wallpaper = {
|
|
|
|
Unit = {
|
|
|
|
Description = "Applies wallpaper";
|
|
|
|
After = singleton "graphical-session-pre.target";
|
|
|
|
PartOf = singleton "graphical-session.target";
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = pkgs.writeShellScript "apply-wallpaper" ''
|
|
|
|
if [[ -f "$HOME/.config/wallpaper" ]]
|
|
|
|
then
|
|
|
|
${getExe pkgs.feh} --no-fehbg --bg-fill "$HOME/.config/wallpaper"
|
|
|
|
else
|
|
|
|
${getExe pkgs.feh} --no-fehbg --bg-fill ${./default.png}
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
Install.WantedBy = singleton "graphical-session.target";
|
|
|
|
};
|
|
|
|
}
|