Regenerated

This commit is contained in:
2026-03-29 15:10:16 +00:00
parent 9ef2f5c25b
commit 97cc4938d3
3 changed files with 387 additions and 291 deletions
@@ -5,10 +5,11 @@ let
homeDir = "/home/${username}";
wallpaperSrc = "${flakeRoot}/assets/traveldroid/Wallpapers";
wallpaperDst = "${homeDir}/Wallpapers";
scriptFile = "${homeDir}/Wallpapers/scripts/set-wallpapers-at-logon.sh";
in
{
# Make bash available
environment.systemPackages = [ pkgs.bash ];
environment.systemPackages = [ pkgs.bash pkgs.rsync pkgs.jq ];
# Create the copy script using Home Manager, following Waybar style
home-manager.users = {
@@ -56,4 +57,35 @@ in
wantedBy = [ "default.target" ];
};
############################
# User service to run wallpaper script
############################
systemd.user.services.wallpaperAtLogon = {
description = "Run wallpaper logon script";
after = [ "graphical-session.target" ];
wants = [ "graphical-session.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = scriptFile;
Restart = "no";
};
wantedBy = [ "default.target" ];
};
############################
# Timer to run the script at login and every 15 minutes
############################
systemd.user.timers.wallpaperAtLogonTimer = {
description = "Run wallpaper script at login and every 15 minutes";
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "1min"; # run 1 minute after login
OnUnitActiveSec = "15min"; # repeat every 15 minutes
Persistent = true; # catch up missed runs
};
};
}