1
0
mirror of https://github.com/ellmau/nixos.git synced 2025-12-19 09:29:36 +01:00

Add background image service (based on feh calls)

This commit is contained in:
Stefan Ellmauthaler 2023-08-14 15:29:26 +02:00
parent 743ea3116e
commit 3c2800b7d4
Failed to extract signature
3 changed files with 36 additions and 0 deletions

View File

@ -126,6 +126,7 @@ with lib; {
};
hooks.postswitch = {
"polybar" = "systemctl --user restart polybar.service";
change-bg = "/home/ellmau/.fehbg";
};
};
};

View File

@ -0,0 +1,34 @@
{
config,
pkgs,
lib,
nixosConfig,
...
}:
with lib; {
config = let
cfg = nixosConfig.elss.graphical.xserver;
fehArgs = "--bg-fill --no-fehbg";
in
mkIf cfg.enable {
systemd.user = {
services = {
desktop-background = {
Unit = {
Description = "Set desktop background";
Documentation = ["man:feh(1)"];
After = ["graphical-session-pre.target"];
ParOf = ["graphical-session.target"];
};
Service = {
type = "oneshot";
ExecStart = "${pkgs.feh}/bin/feh ${fehArgs} ${config.xdg.configHome}/background.png";
};
Install = {WantedBy = ["graphical-session.target"];};
};
};
};
};
}

View File

@ -24,6 +24,7 @@
./waybar.nix
./graphical.nix
./background-x.nix
];
services = {
gnome-keyring = {