Files
VoelinClient/scripts/shots.sh
T
selikhovandClaude Opus 5.5 460024f723 voelin-ui: keep the studio to one stream and one window where needed
A session has one stream of ours: a quick share now refuses to start
where the studio is live, as Go Live already refused where a share runs.
Android runs one window, so the studio cannot be detached there (a wide
tablet shows the desktop layout and its detach button). The studio's
window sets the standard widgets' colour scheme from its theme, as the
main window does, and the dialogs keep their fields under their labels.

Headless screenshots also drop XDG_SESSION_TYPE: with it the push-to-talk
hotkey (and screen capture) pick the desktop portal of the user's
Wayland session even on Xvfb, which can ask the real desktop to bind a
shortcut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 07:46:27 +03:00

34 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# Take a screenshot of the app with sample data, headless.
#
# scripts/shots.sh <out.png> <VOELIN_OPEN> [<width>x<height>]
#
# The pictures in docs/screenshots/ are made this way (and reduced to 256
# colours with `convert -colors 256 PNG8:`).
#
# WAYLAND_DISPLAY is removed so the window opens on the Xvfb server and not
# on the desktop of a Wayland session (winit prefers Wayland when it can),
# and XDG_SESSION_TYPE so nothing picks the desktop portal for a Wayland
# session (the push-to-talk hotkey would ask the desktop to bind it).
# The screen is twice the window's size, so the pointer (in its middle) is
# not over the window and nothing shows as hovered. FFmpeg stays off: the
# pictures need no hardware encoders, and probing them can crash in some
# drivers. Extra arguments (`--set ui.theme=light`) come from $ARGS.
set -eu
out=$1
open=$2
size=${3:-1440x960}
w=${size%x*}
h=${size#*x}
bin=${VOELIN_BIN:-$CARGO_TARGET_DIR/debug/voelin}
env -u WAYLAND_DISPLAY -u XDG_SESSION_TYPE \
SLINT_BACKEND=winit-software \
VOELIN_FFMPEG=0 \
VOELIN_DATA_DIR="$(mktemp -d)" \
VOELIN_DEMO_UI=1 \
VOELIN_OPEN="$open" \
VOELIN_WINDOW_SIZE="$size" \
VOELIN_SCREENSHOT="$out" \
VOELIN_SCREENSHOT_DELAY="${DELAY:-4}" \
xvfb-run -a -s "-screen 0 $((w * 2))x$((h * 2))x24" "$bin" ${ARGS:-} >/dev/null 2>&1