diff --git a/home-manager/modules/profiles/workstation.nix b/home-manager/modules/profiles/workstation.nix index d0ac0ff..b844786 100644 --- a/home-manager/modules/profiles/workstation.nix +++ b/home-manager/modules/profiles/workstation.nix @@ -38,6 +38,7 @@ in ../xmonad ../pantalaimon.nix ../ssh.nix + ../wallpaper ]; programs.librewolf = { diff --git a/home-manager/modules/wallpaper/default.nix b/home-manager/modules/wallpaper/default.nix new file mode 100644 index 0000000..b1c2485 --- /dev/null +++ b/home-manager/modules/wallpaper/default.nix @@ -0,0 +1,29 @@ +{ 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"; + }; +} diff --git a/home-manager/modules/wallpaper/default.png b/home-manager/modules/wallpaper/default.png new file mode 100644 index 0000000..8e439ac Binary files /dev/null and b/home-manager/modules/wallpaper/default.png differ