NetVM: netvm-chrome.sh auto-detects Wayland display

This commit is contained in:
Antigravity Agent
2026-10-03 01:34:12 -04:00
parent f2ac16a437
commit 1d79a69cec
+12
View File
@@ -22,6 +22,18 @@ while [ $# -gt 0 ]; do
esac esac
done done
[ -n "$PROFILE" ] || { usage; exit 1; } [ -n "$PROFILE" ] || { usage; exit 1; }
# Visible launch needs a display. Auto-detect Wayland when the shell
# doesn't have one (e.g. ssh/bare terminal on a Wayland desktop).
if [ -z "${WAYLAND_DISPLAY:-}" ] && [ -z "${DISPLAY:-}" ]; then
for _s in "/run/user/$(id -u)"/wayland-*; do
case "$_s" in *.lock|*'\*') continue;; esac
[ -S "$_s" ] || continue
export WAYLAND_DISPLAY="$(basename "$_s")"
[ -z "${XDG_RUNTIME_DIR:-}" ] && export XDG_RUNTIME_DIR="/run/user/$(id -u)"
echo "display: auto-detected WAYLAND_DISPLAY=$WAYLAND_DISPLAY" >&2
break
done
fi
NODE="$PROFILE" NODE="$PROFILE"
netvm_names "$NODE" netvm_names "$NODE"
CHROME_BOX="${CHROME_BOX_BIN:-$HOME/Projects/chrome-box/chrome-box}" CHROME_BOX="${CHROME_BOX_BIN:-$HOME/Projects/chrome-box/chrome-box}"