repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

test(quickshell): assert screenshot smoke output

c35e5734a1ea04cbda7334449fed223b0805c110

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

docs/super/inventory/2026-06-17-quickshell-theme-screenshot-smoke.md

Modified
22 22 - verifies `FileView.watchChanges` by changing the temp mode file and waiting for `themeMode` to update without explicit `reloadTheme` while source is `auto`;
23 23 - applies watched mode changes from `FileView.onLoaded`, not directly from `onFileChanged`, because a minimal probe showed `text()` can still contain the old file content inside `onFileChanged` immediately after `reload()`;
24 24 - optionally captures cropped scaffold screenshots when `NUGU_QS_SMOKE_SCREENSHOT_DIR` is set;
25 +- fails if either requested screenshot is empty;
25 26 - crops only the focused monitor's top-left rollout region to avoid full-desktop screenshot leakage.
27 28 ## Commands

quickshell/nugu/README.md

Modified
42 42 The smoke runner creates a temporary `HOME` and `XDG_CONFIG_HOME`, symlinks only
43 43 this config as `quickshell/nugu`, runs the audit, starts `qs -c nugu`, checks
44 44 Diagnostics/bar/theme/hideAll IPC, and cleans up its own `qs` process. When
45 -`NUGU_QS_SMOKE_SCREENSHOT_DIR` is set it saves cropped dark/light scaffold
46 -screenshots from the focused monitor; the crop is limited to the top-left rollout
47 -region to avoid full-desktop leakage.
45 +`NUGU_QS_SMOKE_SCREENSHOT_DIR` is set it saves cropped, non-empty dark/light
46 +scaffold screenshots from the focused monitor; the crop is limited to the
47 +top-left rollout region to avoid full-desktop leakage.
49 49 Diagnostics:

quickshell/nugu/smoke.sh

Modified
124 124 # screenshots risk leaking private desktop contents; this crop contains the
125 125 # Quickshell diagnostics swatches and rollout bar only.
126 126 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}")')
127 - grim -g "$geometry" "$screenshot_dir/nugu-qs-$label.png" || fail "screenshot failed for $label"
127 + screenshot_path=$screenshot_dir/nugu-qs-$label.png
128 + grim -g "$geometry" "$screenshot_path" || fail "screenshot failed for $label"
129 + [ -s "$screenshot_path" ] || fail "screenshot for $label is empty"
130 132 mkdir -p "$tmp/quickshell" "$home_tmp/.cache/nugu"