fix(@projects/magic-civilization): 🐛 handle flatpak sandboxed env vars

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-10 03:23:31 -07:00
parent dcdc683ad3
commit a257a6fbc5

View file

@ -21,9 +21,18 @@ cd "$PROJECT_DIR"
echo "=== Magic Civilization Screenshot ==="
echo "Name: $NAME | Scene: $SCENE | Delay: ${DELAY}s"
WAYLAND_DISPLAY="${WAYLAND_DISPLAY:-wayland-0}" \
XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}" \
# flatpak sandboxes env by default — outer WAYLAND_DISPLAY/XDG_RUNTIME_DIR
# are NOT visible inside the sandbox without explicit propagation. Mirror
# the pattern in tools/autoplay-batch.sh weston mode.
WAYLAND_SOCKET="${WAYLAND_DISPLAY:-wayland-0}"
XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"
XDG_RUNTIME_DIR="$XDG_RUNTIME_DIR" \
timeout 60 flatpak run --user \
--socket=wayland \
--filesystem=xdg-run/${WAYLAND_SOCKET} \
--unset-env=DISPLAY \
--env=WAYLAND_DISPLAY="$WAYLAND_SOCKET" \
--env=SCREENSHOT_DELAY="$DELAY" \
--env=SCREENSHOT_NAME="$NAME" \
--env=SCREENSHOT_SCENE="$SCENE" \
@ -32,6 +41,8 @@ timeout 60 flatpak run --user \
--env=FORCE_DISABLE_FOGOFWAR="true" \
org.godotengine.Godot \
--path "$PROJECT_DIR/src/game" \
--display-driver wayland \
--rendering-driver opengl3 \
--rendering-method gl_compatibility \
--fixed-fps 10 2>&1 | tee /tmp/godot_screenshot_log.txt || true