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";
homeDir = "/home/${username}";
wallpaperDst = "${homeDir}/Wallpapers";
scriptSrc = "${flakeRoot}/assets/traveldroid/Wallpapers/set-wallpapers-per-workspace.sh";
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
in
{
############################
@@ -2369,48 +2369,43 @@ in
];
############################
# Systemd timer + service for wallpapers
# Service (does the work)
############################
systemd.user.services.wallpaperUpdater = {
description = "Copy changed wallpapers and set them per workspace every 15 minutes";
after = [ "network.target" ];
description = "Sync wallpapers and apply them";
after = [ "default.target" ];
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = ''
# Ensure destination exists
mkdir -p ${wallpaperDst}
serviceConfig = {
Type = "oneshot";
ExecStart = ''
# Create destination folder
mkdir -p ${wallpaperDst}
# Copy only updated files using rsync
rsync -au --chmod=ugo+rx ${flakeRoot}/assets/traveldroid/Wallpapers/ ${wallpaperDst}/
# Copy FULL folder contents (mirror)
rsync -a --delete ${wallpaperSrc}/ ${wallpaperDst}/
# Ensure the script is executable
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
# Ensure script is executable
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
# Run the wallpaper script
${wallpaperDst}/set-wallpapers-per-workspace.sh
'';
serviceConfig.Restart = "on-failure";
# Run script
${wallpaperDst}/set-wallpapers-per-workspace.sh
'';
};
};
systemd.user.services.wallpaperUpdaterTimer = {
description = "Copy changed wallpapers and set them per workspace";
after = [ "network.target" ];
############################
# Timer (runs every 15 min)
############################
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" ];
timerConfig.OnUnitActiveSec = "15min";
timerConfig.Persistent = true;
timerConfig = {
OnBootSec = "2min"; # run shortly after login
OnUnitActiveSec = "15min"; # repeat every 15 min
Persistent = true;
};
};
}
#+END_SRC
@@ -4,7 +4,7 @@ let
username = config.defaultUser or "henrov";
homeDir = "/home/${username}";
wallpaperDst = "${homeDir}/Wallpapers";
scriptSrc = "${flakeRoot}/assets/traveldroid/Wallpapers/set-wallpapers-per-workspace.sh";
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
in
{
############################
@@ -18,47 +18,42 @@ in
];
############################
# Systemd timer + service for wallpapers
# Service (does the work)
############################
systemd.user.services.wallpaperUpdater = {
description = "Copy changed wallpapers and set them per workspace every 15 minutes";
after = [ "network.target" ];
description = "Sync wallpapers and apply them";
after = [ "default.target" ];
serviceConfig.Type = "oneshot";
serviceConfig.ExecStart = ''
# Ensure destination exists
mkdir -p ${wallpaperDst}
serviceConfig = {
Type = "oneshot";
ExecStart = ''
# Create destination folder
mkdir -p ${wallpaperDst}
# Copy only updated files using rsync
rsync -au --chmod=ugo+rx ${flakeRoot}/assets/traveldroid/Wallpapers/ ${wallpaperDst}/
# Copy FULL folder contents (mirror)
rsync -a --delete ${wallpaperSrc}/ ${wallpaperDst}/
# Ensure the script is executable
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
# Ensure script is executable
chmod +x ${wallpaperDst}/set-wallpapers-per-workspace.sh
# Run the wallpaper script
${wallpaperDst}/set-wallpapers-per-workspace.sh
'';
serviceConfig.Restart = "on-failure";
# Run script
${wallpaperDst}/set-wallpapers-per-workspace.sh
'';
};
};
systemd.user.services.wallpaperUpdaterTimer = {
description = "Copy changed wallpapers and set them per workspace";
after = [ "network.target" ];
############################
# Timer (runs every 15 min)
############################
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" ];
timerConfig.OnUnitActiveSec = "15min";
timerConfig.Persistent = true;
timerConfig = {
OnBootSec = "2min"; # run shortly after login
OnUnitActiveSec = "15min"; # repeat every 15 min
Persistent = true;
};
};
}