detached f7cd1e3

feat(demo): headless recording script for the README demo

commit
f7cd1e39477fbd09fb6ff04d503647ee7974655b
author
brice · · 2026-10-21 04:47 UTC
parent
447c74c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +77 -0
M docs/dev/headless.md +4 -0
@@ -24,6 +24,10 @@ ffmpeg -f concat -safe 0 -i /tmp/shots/frames.ffconcat -vf "fps=60,format=yuv420
2424
2525 For a GIF, convert `demo.mp4` with ffmpeg's `palettegen` and `paletteuse` filters.
2626
27+### Demo recording
28+Run `tools/demo/record.sh` to rebuild and record the 1080p README demo (Go 1.27, foot, bash, fastfetch, ffmpeg).
29+The config and timed input live beside it; temporary captures are kept at the printed path.
30+
2731 ## Input scripts
2832
2933 `--input <file>`, or `--input -` for stdin, plays one command per line:
@@ -24,6 +24,10 @@ ffmpeg -f concat -safe 0 -i /tmp/shots/frames.ffconcat -vf "fps=60,format=yuv420
24 24
25 For a GIF, convert `demo.mp4` with ffmpeg's `palettegen` and `paletteuse` filters.25 For a GIF, convert `demo.mp4` with ffmpeg's `palettegen` and `paletteuse` filters.
26 26
27+### Demo recording
28+Run `tools/demo/record.sh` to rebuild and record the 1080p README demo (Go 1.27, foot, bash, fastfetch, ffmpeg).
29+The config and timed input live beside it; temporary captures are kept at the printed path.
30+
27 ## Input scripts31 ## Input scripts
28 32
29 `--input <file>`, or `--input -` for stdin, plays one command per line:33 `--input <file>`, or `--input -` for stdin, plays one command per line:
A tools/demo/config +10 -0
@@ -0,0 +1,10 @@
1+animations = on
2+terminal = foot -c /dev/null -o font=monospace:size=13 -o colors-dark.background=1a1b26 -o colors-dark.foreground=c0caf5 -e bash --noprofile --norc
3+terminal.auto-open = first
4+layout.gaps = 8
5+border.width = 2
6+border.active = #7aa2f7
7+border.inactive = #414868
8+background = #1a1b26
9+layout.max-columns = 2
10+keyboard.layout = us
@@ -0,0 +1,10 @@
1+animations = on
2+terminal = foot -c /dev/null -o font=monospace:size=13 -o colors-dark.background=1a1b26 -o colors-dark.foreground=c0caf5 -e bash --noprofile --norc
3+terminal.auto-open = first
4+layout.gaps = 8
5+border.width = 2
6+border.active = #7aa2f7
7+border.inactive = #414868
8+background = #1a1b26
9+layout.max-columns = 2
10+keyboard.layout = us
A tools/demo/input.txt +36 -0
@@ -0,0 +1,36 @@
1+sleep 2s
2+move 1918 1078
3+type clear; fastfetch --logo small --structure OS:Kernel:WM:Terminal:Memory:Colors
4+key Return
5+sleep 3s
6+key Super+Return
7+sleep 1500ms
8+type clear; ls -C --color=always /usr/share | head -18
9+key Return
10+sleep 3s
11+key Super+Return
12+sleep 1500ms
13+type clear; printf '\033[1;34mNEFERWL / STASH\033[0m\n\nA window, set aside.\nReady when you are.\n'; seq 1 12
14+key Return
15+sleep 2500ms
16+key Super+Shift+s
17+sleep 1500ms
18+key Super+s
19+sleep 3s
20+key Super+s
21+sleep 1s
22+key Super+Left
23+sleep 1s
24+key Super+Right
25+sleep 1s
26+key Super+o
27+sleep 2s
28+key Left
29+sleep 1s
30+key Up
31+sleep 1s
32+key Return
33+sleep 500ms
34+key Super+s
35+sleep 2s
36+key Ctrl+Alt+BackSpace
@@ -0,0 +1,36 @@
1+sleep 2s
2+move 1918 1078
3+type clear; fastfetch --logo small --structure OS:Kernel:WM:Terminal:Memory:Colors
4+key Return
5+sleep 3s
6+key Super+Return
7+sleep 1500ms
8+type clear; ls -C --color=always /usr/share | head -18
9+key Return
10+sleep 3s
11+key Super+Return
12+sleep 1500ms
13+type clear; printf '\033[1;34mNEFERWL / STASH\033[0m\n\nA window, set aside.\nReady when you are.\n'; seq 1 12
14+key Return
15+sleep 2500ms
16+key Super+Shift+s
17+sleep 1500ms
18+key Super+s
19+sleep 3s
20+key Super+s
21+sleep 1s
22+key Super+Left
23+sleep 1s
24+key Super+Right
25+sleep 1s
26+key Super+o
27+sleep 2s
28+key Left
29+sleep 1s
30+key Up
31+sleep 1s
32+key Return
33+sleep 500ms
34+key Super+s
35+sleep 2s
36+key Ctrl+Alt+BackSpace
A tools/demo/record.sh +27 -0
@@ -0,0 +1,27 @@
1+#!/usr/bin/env bash
2+# Requires Go 1.27, foot 1.28+, bash, fastfetch and ffmpeg; run from any directory.
3+set -euo pipefail
4+root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)
5+cd "$root"
6+work=$(mktemp -d "${TMPDIR:-/tmp}/neferwl-demo.XXXXXX")
7+# Keep the temporary capture for inspection; every run gets a fresh shots dir.
8+printf 'Capture directory: %s\n' "$work"
9+mkdir -p "$work/shots" docs/media
10+CGO_ENABLED=0 go build -o "$work/neferwl" ./cmd/neferwl
11+env -u NEFERWL_STATE -u NEFERWL_SLOT "$work/neferwl" \
12+ --backend=headless --size 1920x1080 --config tools/demo/config \
13+ --no-xwayland --screenshot "$work/shots" --input tools/demo/input.txt --timeout 35s
14+ffmpeg -hide_banner -loglevel warning -f concat -safe 0 \
15+ -i "$work/shots/frames.ffconcat" -vf 'fps=60,format=yuv420p' \
16+ -c:v libx264 -crf 23 -movflags +faststart docs/media/demo.mp4 -y
17+ffmpeg -hide_banner -loglevel warning -ss 23 -i docs/media/demo.mp4 \
18+ -frames:v 1 -update 1 docs/media/demo.png -y
19+# Keep the optional, smaller preview only when it fits the README asset budget.
20+ffmpeg -hide_banner -loglevel warning -i docs/media/demo.mp4 \
21+ -vf 'fps=10,scale=640:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse' \
22+ "$work/demo.gif" -y
23+if (( $(wc -c < "$work/demo.gif") < 5000000 )); then
24+ cp "$work/demo.gif" docs/media/demo.gif
25+else
26+ printf 'GIF exceeds 5 MB; skipped (candidate: %s/demo.gif).\n' "$work"
27+fi
@@ -0,0 +1,27 @@
1+#!/usr/bin/env bash
2+# Requires Go 1.27, foot 1.28+, bash, fastfetch and ffmpeg; run from any directory.
3+set -euo pipefail
4+root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/../.." && pwd)
5+cd "$root"
6+work=$(mktemp -d "${TMPDIR:-/tmp}/neferwl-demo.XXXXXX")
7+# Keep the temporary capture for inspection; every run gets a fresh shots dir.
8+printf 'Capture directory: %s\n' "$work"
9+mkdir -p "$work/shots" docs/media
10+CGO_ENABLED=0 go build -o "$work/neferwl" ./cmd/neferwl
11+env -u NEFERWL_STATE -u NEFERWL_SLOT "$work/neferwl" \
12+ --backend=headless --size 1920x1080 --config tools/demo/config \
13+ --no-xwayland --screenshot "$work/shots" --input tools/demo/input.txt --timeout 35s
14+ffmpeg -hide_banner -loglevel warning -f concat -safe 0 \
15+ -i "$work/shots/frames.ffconcat" -vf 'fps=60,format=yuv420p' \
16+ -c:v libx264 -crf 23 -movflags +faststart docs/media/demo.mp4 -y
17+ffmpeg -hide_banner -loglevel warning -ss 23 -i docs/media/demo.mp4 \
18+ -frames:v 1 -update 1 docs/media/demo.png -y
19+# Keep the optional, smaller preview only when it fits the README asset budget.
20+ffmpeg -hide_banner -loglevel warning -i docs/media/demo.mp4 \
21+ -vf 'fps=10,scale=640:-1:flags=lanczos,split[a][b];[a]palettegen[p];[b][p]paletteuse' \
22+ "$work/demo.gif" -y
23+if (( $(wc -c < "$work/demo.gif") < 5000000 )); then
24+ cp "$work/demo.gif" docs/media/demo.gif
25+else
26+ printf 'GIF exceeds 5 MB; skipped (candidate: %s/demo.gif).\n' "$work"
27+fi

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 25

Tags 10

↑↓ moveenter openesc close