#!/usr/bin/env bash # Drive a JAPANESE title capture end to end, and ALWAYS put the locale back. # # The first JP capture (2026-08-30) demonstrated the logo stack is at rest # WITHIN a run: five frames ~1.5 s apart, byte-identical over the port's ROI, # against a whole-frame contrast control showing 5-8 % of the screen moving. # That does not test the axis sylpheed-port's drift was on -- BETWEEN runs, where # a free-running clock lands somewhere else on a fresh boot. This script exists # to take a second, independent capture so that axis can be measured. # # Usage: jp_title_session.sh OUTDIR [wait_s] set -u export HOME=/sylph-home/re SDL_AUDIODRIVER=dummy DISPLAY=:98 SD="$(cd "$(dirname "$0")" && pwd)" OUT="${1:-/sylph-home/re/jp2}"; WAIT="${2:-700}" mkdir -p "$OUT" restore() { echo "-- restoring locale --" python3 "$SD/set_console_language.py" en || echo "RESTORE FAILED -- check by hand" python3 "$SD/set_console_language.py" --show } trap restore EXIT INT TERM ps -o pid= -C xenia_canary | xargs -r kill -9 # kill by NAME: `pkill -f` matches this shell python3 "$SD/set_console_language.py" ja python3 "$SD/set_console_language.py" --show ( cd "$OUT" && nohup run-canary --mem_watch=false \ --logged_profile_slot_0_xuid=B13EBABEBABEBABE \ >"$OUT/canary.stdout" 2>"$OUT/canary.stderr" & ) sleep 8 timeout $((WAIT + 120)) python3 "$SD/jp_title_capture.py" "$OUT" "$WAIT" echo "CAPTURE STEP DONE" ls -la "$OUT"/*.png 2>/dev/null | head