Regenerated
This commit is contained in:
@@ -17,42 +17,35 @@ in
|
||||
];
|
||||
|
||||
############################
|
||||
# Copy Wallpapers and Script
|
||||
# Systemd timer + service for wallpapers
|
||||
############################
|
||||
systemd.user.services.copyWallpapers = {
|
||||
description = "Copy Wallpapers and script to home";
|
||||
systemd.user.services.wallpaperUpdater = {
|
||||
description = "Copy wallpapers and set them per workspace every 15 minutes";
|
||||
after = [ "network.target" ];
|
||||
wants = [];
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
serviceConfig.ExecStart = ''
|
||||
# Ensure destination exists
|
||||
mkdir -p ${wallpaperDst}
|
||||
|
||||
# Copy wallpapers from flake
|
||||
cp -r ${flakeRoot}/assets/traveldroid/Wallpapers/* ${wallpaperDst}/
|
||||
chown -R ${username}:${username} ${wallpaperDst}
|
||||
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
|
||||
|
||||
# Run the wallpaper script
|
||||
${wallpaperDst}/set-wallpapers-per-workspace.sh
|
||||
'';
|
||||
enable = true;
|
||||
# Optional: restart if it fails
|
||||
serviceConfig.Restart = "on-failure";
|
||||
};
|
||||
|
||||
############################
|
||||
# Periodic wallpaper updater
|
||||
############################
|
||||
systemd.user.services.wallpaperPerWorkspace = {
|
||||
description = "Set wallpapers per workspace every 15 minutes";
|
||||
after = [ "copyWallpapers.service" ];
|
||||
wants = [ "copyWallpapers.service" ];
|
||||
serviceConfig.Type = "simple";
|
||||
serviceConfig.ExecStart = "${wallpaperDst}/set-wallpapers-per-workspace.sh";
|
||||
install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
|
||||
systemd.user.timers.wallpaperPerWorkspace = {
|
||||
description = "Run wallpaper updater every 15 minutes";
|
||||
systemd.user.timers.wallpaperUpdaterTimer = {
|
||||
description = "Run wallpaperUpdater service every 15 minutes";
|
||||
timerConfig.OnUnitActiveSec = "15min";
|
||||
timerConfig.Persistent = true;
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
OnBootSec = "1min";
|
||||
OnUnitActiveSec = "15min";
|
||||
Persistent = true; # ensures catch-up if missed
|
||||
};
|
||||
unit = "wallpaperPerWorkspace.service";
|
||||
enable = true;
|
||||
unit = "wallpaperUpdater.service";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user