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:
parent
743ea3116e
commit
3c2800b7d4
@ -126,6 +126,7 @@ with lib; {
|
||||
};
|
||||
hooks.postswitch = {
|
||||
"polybar" = "systemctl --user restart polybar.service";
|
||||
change-bg = "/home/ellmau/.fehbg";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
34
users/ellmau/background-x.nix
Normal file
34
users/ellmau/background-x.nix
Normal 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"];};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@ -24,6 +24,7 @@
|
||||
./waybar.nix
|
||||
|
||||
./graphical.nix
|
||||
./background-x.nix
|
||||
];
|
||||
services = {
|
||||
gnome-keyring = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user