v0.3.1 7a3b92c

headless.sh RawHistoryFolder

1#!/bin/bash
2# Run neferbar against a nested headless NeferWL with a clean environment.
3# usage: scripts/headless.sh <config> <seconds> [neferbar args...]
4# env: TERMINAL and NEFERWL_STATE are passed through; SIZE=WxH (output size), SCALE=1.5 (output scale), OUT=dir (screenshots),
5#      DISPLAY_VAR=NEFERBAR_DISPLAY (pass the socket that way), NEFERBAR=binary, LOGLINES=n (compositor log lines to show).
6set -eu
7cfg=$1; secs=$2; shift 2
8out=${OUT:-/tmp/neferbar-shots}
9root=$(mktemp -d)
10mkdir -p "$root"/{run,config/neferwl,data,state} "$out"
11if [ -n "${TERMINAL:-}" ]; then ln -s "$HOME/.config/$(basename "${TERMINAL%% *}")" "$root/config/$(basename "${TERMINAL%% *}")" 2>/dev/null; fi
12chmod 700 "$root/run"
13rm -f "$out"/*.png
14if [ -n "${SCALE:-}" ]; then
15	printf 'output.HEADLESS-1.scale = %s\n' "$SCALE" >"$root/config/neferwl/config"
16fi
17clean=(env -i PATH="$PATH" HOME="$root" XDG_RUNTIME_DIR="$root/run" XDG_CONFIG_HOME="$root/config" XDG_DATA_HOME="$root/data" XDG_STATE_HOME="$root/state" ${NEFERWL_STATE:+NEFERWL_STATE="$NEFERWL_STATE"} ${TERMINAL:+TERMINAL="$TERMINAL"})
18"${clean[@]}" neferwl --backend=headless --no-terminal --no-xwayland --size "${SIZE:-800x200}" --timeout "$((secs + 6))s" --screenshot "$out" >"$root/neferwl.log" 2>&1 &
19comp=$!
20trap 'kill $comp 2>/dev/null || true; wait $comp 2>/dev/null || true' EXIT
21for _ in $(seq 100); do
22	sock=""
23	for f in "$root"/run/wayland-*; do
24		[ -e "$f" ] && [[ $f != *.lock ]] && sock=$f && break
25	done
26	[ -n "$sock" ] && break
27	sleep 0.1
28done
29[ -n "${sock:-}" ] || { echo "no compositor socket"; cat "$root/neferwl.log"; exit 1; }
30set +e
31timeout "$secs" "${clean[@]}" "${DISPLAY_VAR:-WAYLAND_DISPLAY}=$sock" "${NEFERBAR:-/tmp/neferbar}" -config "$cfg" "$@"
32echo "neferbar exit: $?"
33echo "--- compositor log"; grep -v "not a conformant" "$root/neferwl.log" | tail -"${LOGLINES:-8}"; cp "$root/neferwl.log" /tmp/neferwl-last.log

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 5

Tags 4

↑↓ moveenter openesc close