mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-04-25 09:28:27 +02:00
refactor(home/linux/desktop): home/linux/desktop => home/linux/gui
This commit is contained in:
31
home/linux/gui/base/wallpaper/default.nix
Normal file
31
home/linux/gui/base/wallpaper/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
wallpapers,
|
||||
...
|
||||
}: {
|
||||
systemd.user.services.wallpaper = {
|
||||
Unit = {
|
||||
Description = "Wallpaper Switcher daemon";
|
||||
After = ["graphical-session-pre.target" "xdg-desktop-autostart.target"];
|
||||
Wants = ["graphical-session-pre.target"];
|
||||
};
|
||||
Install.WantedBy = ["graphical-session.target"];
|
||||
Service = {
|
||||
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
||||
name = "wallpaper";
|
||||
runtimeInputs = with pkgs; [procps feh swaybg python3];
|
||||
text = ''
|
||||
export WALLPAPERS_DIR="${wallpapers}"
|
||||
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
||||
export WALLPAPER_WAIT_MIN=60
|
||||
export WALLPAPER_WAIT_MAX=180
|
||||
exec ${./wallpaper-switcher.py}
|
||||
'';
|
||||
});
|
||||
RestartSec = 3;
|
||||
Restart = "on-failure";
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user