The fake services gain a Trakt API (port 19894) and a sequel that is not in the library; a new scene shows the Anticipated list. The other pictures are retaken (Config has the Trakt section, the search status bar mentions [ ] lists, the calendar is two days on). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
69 lines
2.5 KiB
Bash
Executable File
69 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Take the README screenshots: build arr-tui, start the fake services with the
|
|
# made-up library, and run every scene in Ghostty on a virtual X display. The
|
|
# pictures go to docs/screenshots/ (losslessly compressed if oxipng is there).
|
|
#
|
|
# Needs: go, python3, ghostty, xvfb-run (Xvfb), xdotool, ImageMagick 7,
|
|
# fontconfig with DejaVu fonts; oxipng optional. On NixOS:
|
|
# nix-shell -p xvfb-run xorg-server xdotool imagemagick oxipng --run dev/screenshots/take.sh
|
|
set -euo pipefail
|
|
here=$(cd "$(dirname "$0")" && pwd)
|
|
repo=$(cd "$here/../.." && pwd)
|
|
out=$repo/docs/screenshots
|
|
# The Config view shows the config file's path; keep it neutral.
|
|
demo=/tmp/arr-tui-demo
|
|
|
|
for tool in go python3 ghostty xvfb-run xdotool magick fc-match; do
|
|
command -v "$tool" >/dev/null || { echo "take.sh: $tool is missing" >&2; exit 1; }
|
|
done
|
|
|
|
work=$(mktemp -d)
|
|
cleanup() {
|
|
[[ -n ${server:-} ]] && kill "$server" 2>/dev/null
|
|
rm -rf "$work" "$demo"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
echo "building arr-tui"
|
|
go build -C "$repo" -o "$work/arr-tui" ./cmd/arr-tui
|
|
|
|
[[ -d $here/posters ]] || { echo "generating posters"; "$here/posters.sh"; }
|
|
|
|
echo "starting the fake Radarr, Sonarr, SABnzbd and Trakt"
|
|
export ARR_TUI_TRAKT_URL=http://127.0.0.1:19894
|
|
python3 "$here/server.py" &
|
|
server=$!
|
|
sleep 1
|
|
|
|
# One config per theme, each at $demo/<theme>/.config/arr-tui/config.json.
|
|
for theme in dark light; do
|
|
mkdir -p "$demo/$theme/.config/arr-tui"
|
|
cat >"$demo/$theme/.config/arr-tui/config.json" <<JSON
|
|
{
|
|
"radarr": {"url": "http://127.0.0.1:19891", "apikey": "0123456789abcdef0123456789abcdef", "default_quality_profile": "Ultra-HD", "default_root_folder": "/movies"},
|
|
"sonarr": {"url": "http://127.0.0.1:19892", "apikey": "0123456789abcdef0123456789abcdef", "default_quality_profile": "HD-1080p", "default_root_folder": "/tv"},
|
|
"sabnzbd": {"url": "http://127.0.0.1:19893", "apikey": "0123456789abcdef0123456789abcdef"},
|
|
"trakt": {"client_id": "0123456789abcdef0123456789abcdef"},
|
|
"ui": {"theme": "$theme"}
|
|
}
|
|
JSON
|
|
chmod 600 "$demo/$theme/.config/arr-tui/config.json"
|
|
done
|
|
|
|
mkdir -p "$out"
|
|
shoot() { # scene theme [ghostty args]
|
|
echo "scene $1"
|
|
XDG_CONFIG_HOME=$demo/$2/.config "$here/xshot.sh" "$here/scenes/$1.txt" "$out" "${3:-}" "$work/arr-tui"
|
|
}
|
|
shoot views dark
|
|
shoot discover dark
|
|
shoot episodes dark
|
|
shoot config dark
|
|
shoot light light "--background=eeeeee --foreground=1c1c1c"
|
|
|
|
if command -v oxipng >/dev/null; then
|
|
oxipng -o 4 --strip safe -q "$out"/*.png
|
|
fi
|
|
echo "screenshots in $out:"
|
|
ls "$out"
|