S049: smoke.sh visible runs per D-045

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-13 08:05:16 -06:00
commit e434bd260d

View file

@ -25,9 +25,8 @@
# session bus, so the OS keyring path is used (cookie key, S025); SMOKE_HOME reruns find the same
# key. Without it the run's bus (always private, no service activation) has no keyring.
# SMOKE_VISIBLE=1 show the window on the user's screen (their Wayland display) with the real GPU instead of the
# hidden nested session. Needs this rule in the user's niri config (added by the user), so the
# window opens on DP-1 without focus and nothing moves their workspace; without it the run stops:
# window-rule { match app-id="^dev\.nacre\.Nacre$"; open-on-output "DP-1"; open-focused false; }
# hidden nested session. The window may take focus or switch the workspace (D-045); a niri rule
# like window-rule { match app-id="^dev\.nacre\.Nacre$"; open-on-output "DP-1"; } is optional;
# only the Wayland socket is shared, profile/runtime dir/bus stay throwaway. Selftest page input
# (click, rclick, pagescroll, pagetype) is then synthesized in the page, never the user's pointer.
#
@ -89,11 +88,8 @@ trap cleanup EXIT
if [ -n "$visible" ]; then
runtime=$(mktemp -d /tmp/nacre-smoke-XXXXXX)
chmod 700 "$runtime"
# Share only the compositor socket. Never move the user's focus or workspace: where the window opens and that it
# doesn't take focus comes from the user's niri window rule (header), which this run checks for.
# Share only the compositor socket. The window may take focus (D-045).
ln -s "$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY" "$runtime/wayland-0"
grep -rqs 'dev\\.nacre\\.Nacre' "${XDG_CONFIG_HOME:-$HOME/.config}/niri" \
|| { echo "smoke: SMOKE_VISIBLE needs the niri window rule for dev.nacre.Nacre (see the header); staying hidden is the fallback" >&2; exit 2; }
dispvars=(WAYLAND_DISPLAY=wayland-0 XDG_SESSION_TYPE=wayland GDK_BACKEND=wayland)
else
session=$out/session