dev/screenshots: the tooling for the README screenshots

take.sh builds arr-tui, starts a fake Radarr, Sonarr and SABnzbd with a
made-up library (catalog.py, server.py, generated posters), and runs the
scene scripts in Ghostty under Xvfb, writing docs/screenshots/. Run on the
same day it reproduces the committed pictures byte for byte. make test
also shellchecks the scripts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019reK4DUGYqDUjniWYJvwUW
This commit is contained in:
2026-10-21 17:05:01 +02:00
co-authored by Claude Opus 5.5
parent d84c566412
commit b71659b357
14 changed files with 444 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
# Generate a poster for every title in catalog.py: a gradient with the title
# and year, 500x750 JPEG in posters/. Needs ImageMagick 7 and fontconfig.
set -euo pipefail
cd "$(dirname "$0")"
font=$(fc-match -f '%{file}' 'DejaVu Serif:style=Bold')
small=$(fc-match -f '%{file}' 'DejaVu Sans')
mkdir -p posters
python3 -c '
import catalog
for m in catalog.MOVIES: print("m%d|%s|%d|%s|%s" % (m[0], m[1], m[2], m[10][0], m[10][1]))
for s in catalog.SERIES: print("s%d|%s|%d|%s|%s" % (s[0], s[1], s[2], s[7][0], s[7][1]))
' | while IFS='|' read -r id title year c1 c2; do
magick -size 500x750 "gradient:$c1-$c2" \
\( -size 420x320 -background none -fill white -font "$font" -gravity center caption:"$title" \) \
-gravity north -geometry +0+120 -composite \
\( -size 420x60 -background none -fill '#ffffffcc' -font "$small" -pointsize 30 -gravity center caption:"$year" \) \
-gravity south -geometry +0+70 -composite \
-quality 88 "posters/$id.jpg"
done