NetVM: netvm-chrome.sh auto-detects Wayland display
This commit is contained in:
@@ -22,6 +22,18 @@ while [ $# -gt 0 ]; do
|
||||
esac
|
||||
done
|
||||
[ -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"
|
||||
netvm_names "$NODE"
|
||||
CHROME_BOX="${CHROME_BOX_BIN:-$HOME/Projects/chrome-box/chrome-box}"
|
||||
|
||||
Reference in New Issue
Block a user