Regenerated

This commit is contained in:
2026-03-29 11:32:49 +00:00
parent ae94915563
commit b91564be1b
3 changed files with 372 additions and 387 deletions
+316 -321
View File
File diff suppressed because it is too large Load Diff
+28 -33
View File
@@ -2355,7 +2355,7 @@ let
username = config.defaultUser or "henrov"; username = config.defaultUser or "henrov";
homeDir = "/home/${username}"; homeDir = "/home/${username}";
wallpaperDst = "${homeDir}/Wallpapers"; wallpaperDst = "${homeDir}/Wallpapers";
scriptSrc = "${flakeRoot}/assets/traveldroid/Wallpapers/set-wallpapers-per-workspace.sh"; wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
in in
{ {
############################ ############################
@@ -2369,48 +2369,43 @@ in
]; ];
############################ ############################
# Systemd timer + service for wallpapers # Service (does the work)
############################ ############################
systemd.user.services.wallpaperUpdater = { systemd.user.services.wallpaperUpdater = {
description = "Copy changed wallpapers and set them per workspace every 15 minutes"; description = "Sync wallpapers and apply them";
after = [ "network.target" ]; after = [ "default.target" ];
serviceConfig.Type = "oneshot"; serviceConfig = {
serviceConfig.ExecStart = '' Type = "oneshot";
# Ensure destination exists ExecStart = ''
mkdir -p ${wallpaperDst} # Create destination folder
mkdir -p ${wallpaperDst}
# Copy only updated files using rsync # Copy FULL folder contents (mirror)
rsync -au --chmod=ugo+rx ${flakeRoot}/assets/traveldroid/Wallpapers/ ${wallpaperDst}/ rsync -a --delete ${wallpaperSrc}/ ${wallpaperDst}/
# Ensure the script is executable # Ensure script is executable
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
# Run the wallpaper script # Run script
${wallpaperDst}/set-wallpapers-per-workspace.sh ${wallpaperDst}/set-wallpapers-per-workspace.sh
''; '';
serviceConfig.Restart = "on-failure"; };
}; };
systemd.user.services.wallpaperUpdaterTimer = { ############################
description = "Copy changed wallpapers and set them per workspace"; # Timer (runs every 15 min)
after = [ "network.target" ]; ############################
systemd.user.timers.wallpaperUpdater = {
description = "Run wallpaper updater every 15 minutes";
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = ''
mkdir -p ${wallpaperDst}
rsync -au --chmod=ugo+rx ${flakeRoot}/assets/traveldroid/Wallpapers/ ${wallpaperDst}/
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
${wallpaperDst}/set-wallpapers-per-workspace.sh
'';
serviceConfig.Restart = "on-failure";
};
systemd.user.timers.wallpaperUpdaterTimer = {
description = "Run wallpaperUpdater service every 15 minutes";
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig.OnUnitActiveSec = "15min";
timerConfig.Persistent = true; timerConfig = {
OnBootSec = "2min"; # run shortly after login
OnUnitActiveSec = "15min"; # repeat every 15 min
Persistent = true;
};
}; };
} }
#+END_SRC #+END_SRC
@@ -4,7 +4,7 @@ let
username = config.defaultUser or "henrov"; username = config.defaultUser or "henrov";
homeDir = "/home/${username}"; homeDir = "/home/${username}";
wallpaperDst = "${homeDir}/Wallpapers"; wallpaperDst = "${homeDir}/Wallpapers";
scriptSrc = "${flakeRoot}/assets/traveldroid/Wallpapers/set-wallpapers-per-workspace.sh"; wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
in in
{ {
############################ ############################
@@ -18,47 +18,42 @@ in
]; ];
############################ ############################
# Systemd timer + service for wallpapers # Service (does the work)
############################ ############################
systemd.user.services.wallpaperUpdater = { systemd.user.services.wallpaperUpdater = {
description = "Copy changed wallpapers and set them per workspace every 15 minutes"; description = "Sync wallpapers and apply them";
after = [ "network.target" ]; after = [ "default.target" ];
serviceConfig.Type = "oneshot"; serviceConfig = {
serviceConfig.ExecStart = '' Type = "oneshot";
# Ensure destination exists ExecStart = ''
mkdir -p ${wallpaperDst} # Create destination folder
mkdir -p ${wallpaperDst}
# Copy only updated files using rsync # Copy FULL folder contents (mirror)
rsync -au --chmod=ugo+rx ${flakeRoot}/assets/traveldroid/Wallpapers/ ${wallpaperDst}/ rsync -a --delete ${wallpaperSrc}/ ${wallpaperDst}/
# Ensure the script is executable # Ensure script is executable
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
# Run the wallpaper script # Run script
${wallpaperDst}/set-wallpapers-per-workspace.sh ${wallpaperDst}/set-wallpapers-per-workspace.sh
''; '';
serviceConfig.Restart = "on-failure"; };
}; };
systemd.user.services.wallpaperUpdaterTimer = { ############################
description = "Copy changed wallpapers and set them per workspace"; # Timer (runs every 15 min)
after = [ "network.target" ]; ############################
systemd.user.timers.wallpaperUpdater = {
description = "Run wallpaper updater every 15 minutes";
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = ''
mkdir -p ${wallpaperDst}
rsync -au --chmod=ugo+rx ${flakeRoot}/assets/traveldroid/Wallpapers/ ${wallpaperDst}/
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
${wallpaperDst}/set-wallpapers-per-workspace.sh
'';
serviceConfig.Restart = "on-failure";
};
systemd.user.timers.wallpaperUpdaterTimer = {
description = "Run wallpaperUpdater service every 15 minutes";
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
timerConfig.OnUnitActiveSec = "15min";
timerConfig.Persistent = true; timerConfig = {
OnBootSec = "2min"; # run shortly after login
OnUnitActiveSec = "15min"; # repeat every 15 min
Persistent = true;
};
}; };
} }