mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-29 03:26:13 +01:00
30 lines
693 B
Nix
30 lines
693 B
Nix
|
{ pkgs, lib, ... }:
|
||
|
let
|
||
|
inherit (lib)
|
||
|
singleton
|
||
|
getExe;
|
||
|
in
|
||
|
{
|
||
|
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";
|
||
|
};
|
||
|
}
|