From 41742c1ad041ee7a385c534f9d039caa47dd4428 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Mon, 3 Mar 2025 19:22:07 -0800 Subject: [PATCH] fix(home/swaybg): Make it so the systemd unit can actually succeed at boot --- modules/home/services/swaybg/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/home/services/swaybg/default.nix b/modules/home/services/swaybg/default.nix index e2df7e1..a5c2868 100644 --- a/modules/home/services/swaybg/default.nix +++ b/modules/home/services/swaybg/default.nix @@ -15,14 +15,14 @@ in { systemd.user.services.swaybg = { Install = { - WantedBy = ["graphical-session.target"]; + WantedBy = ["xdg-desktop-autostart.target"]; }; Unit = { Description = "Wallpaper tool for Wayland compositors"; Documentation = ["man:swaybg(1)"]; - After = ["graphical-session-pre.target"]; - PartOf = ["graphical-session.target"]; + After = ["graphical-session.target"]; + PartOf = ["xdg-desktop-autostart.target"]; }; Service = { @@ -31,6 +31,9 @@ in { ExecReload = "${lib.getExe' pkgs.coreutils "kill"} -SIGUSR2 $MAINPID"; KillMode = "mixed"; Restart = "on-failure"; + RestartSec = "1s"; + RestartMaxDelaySec = "30s"; + RestartSteps = 10; }; }; };