Repository Public License
1#!/usr/bin/env bash2# ORIX OS Automation3# File: Scripts/screenshots.sh4# Description: Photographs the real running app, one section per launch, into docs/screenshots/. Uses the app's own window id with screencapture, so the picture is what is on screen.5#6# Author: Simon-Pierre Boucher7# Contact: contact@spboucher.ai8# Scripts/screenshots.sh <data-dir> [section…] (needs Screen Recording for the terminal running it)9set -euo pipefail10cd "$(dirname "$0")/.."11APP="build/dd/Build/Products/Debug/ORIX OS Automation.app/Contents/MacOS/ORIX OS Automation"12DATA="$1"; shift13SECTIONS=("$@"); [[ ${#SECTIONS[@]} -gt 0 ]] || SECTIONS=(dashboard chat workflows code runs scheduler agents skills learn permissions settings)14OUT="${ORIX_SHOT_DIR:-docs/screenshots}"; mkdir -p "$OUT"15for s in "${SECTIONS[@]}"; do16 LOG="$(mktemp)"17 "$APP" -ORIXDataDir "$DATA" -ORIXSkipOnboarding YES -ORIXUITest YES -ORIXSection "$s" -ORIXShot /dev/null -ORIXShotDelay "${ORIX_SHOT_DELAY:-4}" \18 -ORIXShotHold 3 -ORIXWindowSize "${ORIX_SHOT_SIZE:-1320x840}" -AppleLanguages "(${ORIX_SHOT_LANG:-en})" -AppleLocale "${ORIX_SHOT_LOCALE:-en_US}" \19 -ORIXAppearance "${ORIX_SHOT_STYLE:-dark}" -ApplePersistenceIgnoreState YES >"$LOG" 2>/dev/null &20 PID=$!21 ID=""22 for _ in $(seq 1 100); do ID="$(sed -n 's/^ORIX_WINDOW_ID //p' "$LOG" | head -1)"; [[ -n "$ID" ]] && break; sleep 0.2; done23 if [[ -n "$ID" ]]; then sleep 0.6; screencapture -x -o -l "$ID" "$OUT/$s${ORIX_SHOT_SUFFIX:-}.png" && echo "wrote $OUT/$s${ORIX_SHOT_SUFFIX:-}.png"; else echo "no window for $s" >&2; fi24 wait $PID 2>/dev/null || true25 rm -f "$LOG"26done27