# Sourced from the guest's serial console: take the Weston session's variables so a GUI program started here lands in the session. W=$(pidof -s weston) for v in XDG_RUNTIME_DIR DBUS_SESSION_BUS_ADDRESS DISPLAY LANG GDK_BACKEND NO_AT_BRIDGE; do val=$(tr '\0' '\n' < /proc/$W/environ | sed -n "s/^$v=//p" | head -1) [ -n "$val" ] && export "$v=$val" done export XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/0} export WAYLAND_DISPLAY=$(cd "$XDG_RUNTIME_DIR" && ls | grep -m1 -E '^wayland-[0-9]+$')