diff --git a/README.md b/README.md
index b5121fa..c87c67a 100644
--- a/README.md
+++ b/README.md
@@ -49,8 +49,8 @@ interzone servers over IPFS.

Set up: pick a homeserver and any of 63 bridges, bots, clients and services. |
-
-Manage: updates, users, backups, rollback, logs and more. |
+
+Themes: 13 of them, light and dark, switched with ctrl+y. |
diff --git a/docs/screenshots/components.png b/docs/screenshots/components.png
index 2b3f54a..e9fca11 100644
Binary files a/docs/screenshots/components.png and b/docs/screenshots/components.png differ
diff --git a/docs/screenshots/homeserver.png b/docs/screenshots/homeserver.png
index be8326b..138a790 100644
Binary files a/docs/screenshots/homeserver.png and b/docs/screenshots/homeserver.png differ
diff --git a/docs/screenshots/manage.png b/docs/screenshots/manage.png
index fa4dc8d..31d4542 100644
Binary files a/docs/screenshots/manage.png and b/docs/screenshots/manage.png differ
diff --git a/docs/screenshots/phone.png b/docs/screenshots/phone.png
index c81a210..a5d101a 100644
Binary files a/docs/screenshots/phone.png and b/docs/screenshots/phone.png differ
diff --git a/docs/screenshots/server.png b/docs/screenshots/server.png
index b47fb6c..af891ee 100644
Binary files a/docs/screenshots/server.png and b/docs/screenshots/server.png differ
diff --git a/docs/screenshots/settings.png b/docs/screenshots/settings.png
index 4086992..5c4772b 100644
Binary files a/docs/screenshots/settings.png and b/docs/screenshots/settings.png differ
diff --git a/docs/screenshots/themes.png b/docs/screenshots/themes.png
new file mode 100644
index 0000000..1ce2666
Binary files /dev/null and b/docs/screenshots/themes.png differ
diff --git a/docs/screenshots/tuning.png b/docs/screenshots/tuning.png
index 887da14..18bffff 100644
Binary files a/docs/screenshots/tuning.png and b/docs/screenshots/tuning.png differ
diff --git a/docs/screenshots/users.png b/docs/screenshots/users.png
index 9fd2234..3b72806 100644
Binary files a/docs/screenshots/users.png and b/docs/screenshots/users.png differ
diff --git a/docs/screenshots/welcome.png b/docs/screenshots/welcome.png
index 4310a42..31636bd 100644
Binary files a/docs/screenshots/welcome.png and b/docs/screenshots/welcome.png differ
diff --git a/docs/usage.md b/docs/usage.md
index 528a4c8..c4e4c68 100644
--- a/docs/usage.md
+++ b/docs/usage.md
@@ -50,7 +50,8 @@ at the bottom of the menu, cycles auto, compact and wide and remembers the
choice; `-layout` picks one for a single run.
`ctrl+y`, or `◐` under it, switches the colours between interzone,
-Catppuccin, Nord, Gruvbox, Dracula, Solarized and mono; each has a light
+Catppuccin, Nord, Gruvbox, Dracula, Solarized, Tokyo Night, Rosé Pine,
+Everforest, Kanagawa, One Dark, Synthwave and mono; each has a light
and a dark variant that follows the terminal's background.
| Key | Action |
diff --git a/scripts/screenshots/render.py b/scripts/screenshots/render.py
index 8c6c022..affc1e8 100644
--- a/scripts/screenshots/render.py
+++ b/scripts/screenshots/render.py
@@ -4,6 +4,9 @@
# README's screenshots are.
# render.py --join OUT.png A.png B.png …
# Puts already rendered windows side by side (docs/screenshots/phone.png).
+# render.py --slices OUT.png theme-A.png theme-B.png …
+# One window cut into vertical slices, each from the next picture of the
+# same screen, named after the file in the title bar (themes.png).
#
# Needs Pillow, fontTools and the DejaVu and Noto symbol fonts.
import glob, os, re, sys, unicodedata
@@ -26,6 +29,8 @@ FONTS = [font("DejaVuSansMono.ttf"), font("DejaVuSansMono-Bold.ttf")]
FALLBACK = [font("DejaVuSans.ttf"), font("NotoSansSymbols2-Regular.ttf"), font("NotoSansMath-Regular.ttf")]
EMOJI = font("NotoColorEmoji.ttf") # a bitmap font: drawn at 109 px, then scaled
BG, FG = (21, 19, 30), (220, 216, 235)
+if os.environ.get("BG"): # a theme's own background, for themes.png
+ BG = tuple(bytes.fromhex(os.environ["BG"].lstrip("#")))
reg = ImageFont.truetype(FONTS[0], SIZE)
bold = ImageFont.truetype(FONTS[1], SIZE)
@@ -85,6 +90,26 @@ if sys.argv[1] == "--join":
finish(out, sys.argv[2], 1400) # as wide as the other shots
sys.exit()
+if sys.argv[1] == "--slices":
+ paths = sys.argv[3:]
+ parts = [Image.open(p).convert("RGB") for p in paths]
+ out = parts[0].copy()
+ d = ImageDraw.Draw(out)
+ x0, x1 = 40, out.width - 40 # the window, inside the margin render draws
+ step = (x1 - x0) / len(parts)
+ for i, (p, part) in enumerate(zip(paths, parts)):
+ a, b = round(x0 + i * step), round(x0 + (i + 1) * step)
+ out.paste(part.crop((a, 0, b, out.height)), (a, 0))
+ if i:
+ d.line([(a, 40 + 54), (a, out.height - 41)], fill=(13, 12, 19), width=3)
+ name = os.path.basename(p)[:-4].removeprefix("theme-")
+ w = bold.getlength(name)
+ cx = (a + b) / 2 if i else max((a + b) / 2, 150 + w / 2) # clear of the window's dots
+ d.rounded_rectangle([cx - w / 2 - 14, 52, cx + w / 2 + 14, 52 + CH + 4], 12, fill=(58, 54, 80))
+ d.text((cx - w / 2, 54), name, font=bold, fill=FG)
+ finish(out, sys.argv[2], 1400)
+ sys.exit()
+
lines = open(sys.argv[1], encoding="utf-8").read().rstrip("\n").split("\n")
cells = [] # rows of (ch, fg, bg, bold)
sgr = re.compile(r"\x1b\[([0-9;]*)m")
diff --git a/scripts/screenshots/shots.sh b/scripts/screenshots/shots.sh
index 7da7dbd..ace95ce 100755
--- a/scripts/screenshots/shots.sh
+++ b/scripts/screenshots/shots.sh
@@ -12,6 +12,8 @@
# scripts/screenshots/shots.sh phone A B C join three phone shots into phone.png
# scripts/screenshots/shots.sh users draw users.png from the layout tests'
# sample people (no server needed)
+# scripts/screenshots/shots.sh themes from the running session, on Welcome: the
+# screen in a slice of each of THEMES (themes.png)
# scripts/screenshots/shots.sh stop
#
# Drive the session between grabs with tmux send-keys or tmux attach -t shot.
@@ -80,6 +82,28 @@ users() {
python3 "$repo/scripts/screenshots/render.py" "$work/raw/users.ans" "$out/users.png" 1400
}
+# themes cycles every theme with ctrl+y on Welcome, grabbing the screen in
+# the ones named here, and ends on the first theme again. Up and down
+# clear the "theme: …" note that takes the place of the key hints.
+THEMES="interzone catppuccin nord gruvbox everforest synthwave"
+themes() {
+ pngs=()
+ for t in $("$work/iz" -help 2>&1 | sed -n 's/.*the colours for this run: \(.*\); ctrl+y.*/\1/p' | tr -d ,); do
+ waitfor "◐ $t "
+ waitfor "◉ Manage the server"
+ waitfor "enter continue"
+ if [[ " $THEMES " == *" $t "* ]]; then
+ # the window in the theme's own background, its dark panel colour
+ BG=$(sed -n "/{\"$t\",/,/}},/p" "$repo/internal/ui/theme.go" | grep -o 'Dark: "#[0-9A-Fa-f]*"' | sed -n '9s/.*"\(#.*\)"/\1/p') \
+ grab "theme-$t" 0
+ pngs+=("$work/raw/theme-$t.png")
+ fi
+ press C-y
+ press Up && press Down
+ done
+ python3 "$repo/scripts/screenshots/render.py" --slices "$out/themes.png" "${pngs[@]}"
+}
+
stop() {
tmux kill-session -t shot 2>/dev/null || true
}
@@ -116,7 +140,9 @@ press() {
before=$(screen)
tmux send-keys -t shot "$1"
for _ in $(seq 20); do
- [ "$(screen)" != "$before" ] && return
+ now=$(screen)
+ # a step change blanks the screen for a moment: that isn't the new one yet
+ [ "$now" != "$before" ] && [ -n "${now//[[:space:]]/}" ] && return
sleep 0.1
done
}
@@ -147,6 +173,7 @@ all() {
press Escape
waitfor "Manage the server"
grab welcome
+ themes
toHomeserver server
grab homeserver
press Down && press Down && press Down
@@ -191,12 +218,12 @@ all() {
cmd=${1:-}
case $cmd in
-start | grab | phone | users | stop | all)
+start | grab | phone | users | themes | stop | all)
shift
"$cmd" "$@"
;;
*)
- sed -n '2,22p' "$0" | sed 's/^# \{0,1\}//'
+ sed -n '2,24p' "$0" | sed 's/^# \{0,1\}//'
exit 1
;;
esac