From 268733f96883acdcd25aa306101ee71b7856e409 Mon Sep 17 00:00:00 2001 From: enricobuehler Date: Sat, 13 Jun 2026 18:21:31 +0000 Subject: [PATCH] fix(headless/kde): find the probe binary on PATH for packaged installs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit run-headless-kde.sh gated KWin readiness on `$ROOT/target/release/punktfunk-host probe-compositor`, else `cargo run`. On an RPM/.deb install ROOT resolves to /usr/share (no target/ tree) and there's no Cargo.toml either, so the probe could never succeed: the session unit hit its 30s readiness timeout, exited, and systemd restart-looped it forever — KWin never reached the plasmashell step, so the streamed virtual output was an empty black desktop. Add a `command -v punktfunk-host` branch (the packaged /usr/bin binary) between the source-tree and cargo-run fallbacks. Verified live on the Fedora 44 KDE host: session goes stable (NRestarts 0), plasmashell comes up, and a client streams the real desktop. Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/headless/run-headless-kde.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/headless/run-headless-kde.sh b/scripts/headless/run-headless-kde.sh index 64be292..b8fe959 100755 --- a/scripts/headless/run-headless-kde.sh +++ b/scripts/headless/run-headless-kde.sh @@ -32,12 +32,17 @@ export WAYLAND_DISPLAY=wayland-kde export KWIN_WAYLAND_NO_PERMISSION_CHECKS=1 # The probe binary (gates readiness on KWin actually exposing zkde_screencast — not merely -# the socket existing). Use a release build if present, else fall back to `cargo run`. +# the socket existing). Prefer a source-tree build (dev box), then a packaged install on PATH +# (the RPM/.deb put it at /usr/bin — there is no $ROOT/target there, and the old cargo-run +# fallback has no Cargo.toml either, so without this the probe never succeeds and the session +# restart-loops), then `cargo run` as a last resort. ROOT="$(cd "$(dirname "$0")/../.." && pwd)" if [[ -x "$ROOT/target/release/punktfunk-host" ]]; then PROBE=("$ROOT/target/release/punktfunk-host" probe-compositor) elif [[ -x "$ROOT/target/debug/punktfunk-host" ]]; then PROBE=("$ROOT/target/debug/punktfunk-host" probe-compositor) +elif command -v punktfunk-host >/dev/null 2>&1; then + PROBE=(punktfunk-host probe-compositor) else PROBE=(cargo run -q --manifest-path "$ROOT/Cargo.toml" -p punktfunk-host -- probe-compositor) fi