From a257a6fbc5f910f197959eea5cbe3273ae4eef6c Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 10 May 2026 03:23:31 -0700 Subject: [PATCH] =?UTF-8?q?fix(@projects/magic-civilization):=20?= =?UTF-8?q?=F0=9F=90=9B=20handle=20flatpak=20sandboxed=20env=20vars?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- tools/screenshot.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/screenshot.sh b/tools/screenshot.sh index ea51cf23..d5d8842f 100755 --- a/tools/screenshot.sh +++ b/tools/screenshot.sh @@ -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