test(quickshell): capture theme smoke screenshots
3d61dd8c1ba34ab4ef26a50d24607914acf272f0
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: 9c3ca2647e15
bugabingas dorkfiles
3d61dd8c1ba34ab4ef26a50d24607914acf272f0
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+117 / −9 text lines
new file mode 100644+75 / −0 text lines
# Quickshell Nugu theme screenshot smokeDate: 2026-06-17## ScopeExtend the existing self-contained scaffold smoke so dark/light diagnostics screenshots can be captured repeatably without linking live config or starting `quickshell.service`.No live services were started, stopped, enabled, disabled, linked, or retired.## Change`quickshell/nugu/smoke.sh` now:- starts with temporary `HOME` and `XDG_CONFIG_HOME`, preserving live `~/.config/quickshell` and live `~/.cache/nugu/mode`;- explicitly renders the scaffold in dark mode and light mode;- still verifies `setThemeMode auto` from the temp Nugu mode cache;- optionally captures cropped scaffold screenshots when `NUGU_QS_SMOKE_SCREENSHOT_DIR` is set;- crops only the focused monitor's top-left rollout region to avoid full-desktop screenshot leakage.## CommandsDefault gate:```shcd /home/oli/Workspace/dotfilesquickshell/nugu/smoke.shpgrep -a qs || true```Observed:```textPASS nugu quickshell scaffold smokeinitial={"theme":"dark","diagnostics":false,"bar":false,"nativeNotifications":false,"launcher":false,"clipboardPicker":false,"powerMenu":false,"pendingPower":"","lastOsd":"","lastPower":""}dark_open={"theme":"dark","diagnostics":true,"bar":true,"nativeNotifications":false,"launcher":false,"clipboardPicker":false,"powerMenu":false,"pendingPower":"","lastOsd":"","lastPower":""}light_open={"theme":"light","diagnostics":true,"bar":true,"nativeNotifications":false,"launcher":false,"clipboardPicker":false,"powerMenu":false,"pendingPower":"","lastOsd":"","lastPower":""}auto_light=lightafter_reload=darkhidden={"theme":"dark","diagnostics":false,"bar":false,"nativeNotifications":false,"launcher":false,"clipboardPicker":false,"powerMenu":false,"pendingPower":"","lastOsd":"","lastPower":""}smoke_exit=0--- lingering qs ---```Screenshot gate:```shrm -rf /tmp/nugu-qs-theme-smokeNUGU_QS_SMOKE_SCREENSHOT_DIR=/tmp/nugu-qs-theme-smoke quickshell/nugu/smoke.shls -l /tmp/nugu-qs-theme-smokepgrep -a qs || true```Observed:```textPASS nugu quickshell scaffold smokescreenshot_dark=/tmp/nugu-qs-theme-smoke/nugu-qs-dark.pngscreenshot_light=/tmp/nugu-qs-theme-smoke/nugu-qs-light.pngsmoke_exit=0--- screenshots ----rw-r--r-- 1 oli oli 19695 Jun 17 05:58 nugu-qs-dark.png-rw-r--r-- 1 oli oli 19037 Jun 17 05:58 nugu-qs-light.png--- lingering qs ---```Cropped image inspection confirmed both screenshots show the Nugu Quickshell top bar plus Diagnostics swatches, with visible dark/light mode text.## BoundaryThis only closes repeatable scaffold/theme validation. It does not prove full companion parity:- `quickshell.service` remains inactive/not linked.- Ironbar and Mako remain the live services.- Hypr binds still point at old companion helpers until replacement IPC is live/recoverable and approved.+7 / −3 text lines
NUGU_QS_SMOKE_SCREENSHOT_DIR=/tmp/nugu-qs-theme-smoke quickshell/nugu/smoke.shThe smoke runner creates a temporary `XDG_CONFIG_HOME`, symlinks only this configas `quickshell/nugu`, starts `qs -c nugu`, checks diagnostics/theme/hideAll IPC,and cleans up its own `qs` process.The smoke runner creates a temporary `HOME` and `XDG_CONFIG_HOME`, symlinks onlythis config as `quickshell/nugu`, starts `qs -c nugu`, checksDiagnostics/bar/theme/hideAll IPC, and cleans up its own `qs` process. When`NUGU_QS_SMOKE_SCREENSHOT_DIR` is set it saves cropped dark/light scaffoldscreenshots from the focused monitor; the crop is limited to the top-left rolloutregion to avoid full-desktop leakage.+35 / −6 text lines
screenshot_dir=${NUGU_QS_SMOKE_SCREENSHOT_DIR:-}capture_screenshot() { label=$1 [ -n "$screenshot_dir" ] || return 0 command -v grim >/dev/null 2>&1 || fail 'grim is required when NUGU_QS_SMOKE_SCREENSHOT_DIR is set' mkdir -p "$screenshot_dir" # Capture only the top-left scaffold region of the focused monitor. Full-screen # screenshots risk leaking private desktop contents; this crop contains the # Quickshell diagnostics swatches and rollout bar only. geometry=$(hyprctl monitors -j | python -c 'import json, sys; monitors = json.load(sys.stdin); monitor = next((m for m in monitors if m.get("focused")), monitors[0]); x = int(monitor.get("x", 0)); y = int(monitor.get("y", 0)); w = min(460, int(monitor.get("width", 460))); h = min(170, int(monitor.get("height", 170))); print(f"{x},{y} {w}x{h}")') grim -g "$geometry" "$screenshot_dir/nugu-qs-$label.png" || fail "screenshot failed for $label"}mode_dark=$(ipc setThemeMode dark)state_dark_open=$(ipc scaffoldState)assert_contains "$mode_dark" 'dark' theme-darkassert_contains "$state_dark_open" '"theme":"dark"' dark-open-stateassert_contains "$state_dark_open" '"diagnostics":true' dark-open-stateassert_contains "$state_dark_open" '"bar":true' dark-open-stateassert_contains "$state_dark_open" '"nativeNotifications":false' dark-open-statecapture_screenshot darkassert_contains "$state_open" '"theme":"light"' open-stateassert_contains "$state_open" '"diagnostics":true' open-stateassert_contains "$state_open" '"bar":true' open-stateassert_contains "$state_open" '"nativeNotifications":false' open-stateassert_contains "$state_light_open" '"theme":"light"' light-open-stateassert_contains "$state_light_open" '"diagnostics":true' light-open-stateassert_contains "$state_light_open" '"bar":true' light-open-stateassert_contains "$state_light_open" '"nativeNotifications":false' light-open-statecapture_screenshot lightprintf 'open=%s\n' "$state_open"