fix(nix): set_wallpaper tries again until the Plasma shell takes it

The first call of a session that has only just started can find the shell
busy, and plasma-apply-wallpaperimage fails once. wallpaper.run then
failed at its first step for no reason of its own.
This commit is contained in:
LGUG2Z committed 2026-10-30 17:13:50 -07:00
1 parent 635a64d857
commit e6a22e41d6
1 file changed
+4 -1
+4 -1
View File
@@ -262,7 +262,10 @@ class KdePlatform:
return unquote(url.removeprefix("file://"))
def set_wallpaper(self, path: str, display: int = 0) -> None:
self.kde.sh(f"plasma-apply-wallpaperimage {shlex.quote(path)}")
"""The shell may still be starting, or busy: the call is made again until it takes it."""
command = f"plasma-apply-wallpaperimage {shlex.quote(path)}"
if not self.kde.wait_for(lambda: self.kde.run(command)[0] == 0, timeout=60):
raise AssertionError(f"the Plasma shell did not take the wallpaper {path}")
def resize_grab(self, frame: Rect, grab: str) -> tuple[int, int]:
return outside_grab(frame, grab)