From e6a22e41d6d21a536d48de273f7755991c9d75a7 Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 17:13:08 -0700 Subject: [PATCH] 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. --- nix/tests/vm/lib/komorebi_vm/kde_platform.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nix/tests/vm/lib/komorebi_vm/kde_platform.py b/nix/tests/vm/lib/komorebi_vm/kde_platform.py index e66cf966..532bbf42 100644 --- a/nix/tests/vm/lib/komorebi_vm/kde_platform.py +++ b/nix/tests/vm/lib/komorebi_vm/kde_platform.py @@ -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)