repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

test(quickshell): audit local resource paths

bbfb235bb9dfad1b9f899ad0bd2c3658cd7b38b2

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (3)

+30 / −3 text lines

Diff layout

docs/super/inventory/2026-06-17-quickshell-self-contained-audit.md

Modified

+6 / −1 text lines

1313`quickshell/nugu/audit.sh` checks repository state only:
15- required named-config files are present: `shell.qml`, `Theme.qml`, `nugu.json`, `README.md`, `audit.sh`, `smoke.sh`.
1516- QML imports are limited to Qt, Quickshell, and local `import "."`.
16- Every QML component has an early decision comment.
17- every QML component has an early decision comment.
18- local resource references are audited; currently only bundled `nugu.json` is allowed via `Qt.resolvedUrl`.
19- live/repo path markers such as `../`, `~/.config`, and `~/.local` fail the audit.
1720- `quickshell/nugu/nugu.json` exists and matches `hypr/generated/nugu.json`.
1821- executable code does not call retired companion app markers:
1922 - `hyprlauncher`
4144```text
4245PASS nugu quickshell audit
4346qml_files=29
47required_files=shell.qml,Theme.qml,nugu.json,README.md,audit.sh,smoke.sh
4448external_commands=awk,brightnessctl,cliphist,cut,grep,head,hyprctl,hyprlock,hyprpicker,hyprshot,iwctl,loginctl,makoctl,nu,playerctl,satty,sed,sh,systemctl,upower,uptime,uwsm,wezterm,wl-copy,wpctl
4549WARN transitional external bridge still present: cliphist
4650WARN transitional external bridge still present: makoctl
4751PASS nugu quickshell scaffold smoke
4852PASS nugu quickshell audit
4953qml_files=29
54required_files=shell.qml,Theme.qml,nugu.json,README.md,audit.sh,smoke.sh
5055external_commands=awk,brightnessctl,cliphist,cut,grep,head,hyprctl,hyprlock,hyprpicker,hyprshot,iwctl,loginctl,makoctl,nu,playerctl,satty,sed,sh,systemctl,upower,uptime,uwsm,wezterm,wl-copy,wpctl
5156WARN transitional external bridge still present: cliphist
5257WARN transitional external bridge still present: makoctl

quickshell/nugu/README.md

Modified

+3 / −2 text lines

2626NUGU_QS_SMOKE_SCREENSHOT_DIR=/tmp/nugu-qs-theme-smoke quickshell/nugu/smoke.sh
2727```
29The audit checks that QML imports stay local/Qt/Quickshell, every component has
30an early decision comment, the bundled palette matches `hypr/generated/nugu.json`,
29The audit checks that required named-config files are present, QML imports stay
30local/Qt/Quickshell, every component has an early decision comment, local
31resources are audited, the bundled palette matches `hypr/generated/nugu.json`,
3132and retired companion launchers are not executable dependencies. It intentionally
3233warns while transitional `cliphist` and `makoctl` bridges remain; those warnings
3334must disappear before final retirement.

quickshell/nugu/audit.sh

Modified

+21 / −0 text lines

1818warnings = []
1919qml_files = sorted(config_dir.glob("*.qml"))
2020code_by_file = {}
21required_files = ("shell.qml", "Theme.qml", "nugu.json", "README.md", "audit.sh", "smoke.sh")
23for name in required_files:
24 if not (config_dir / name).exists():
25 errors.append(f"missing required self-contained config file {name}")
2227if not qml_files:
2328 errors.append("no QML files found")
5257 if forbidden in code:
5358 errors.append(f"{rel}: executable dependency on retired companion marker {forbidden!r}")
60 # Named-config self-containment: QML may use Quickshell/Qt resource APIs and
61 # the Nugu HOME mode cache, but it must not bake in repo-relative or live
62 # ~/.config paths. That keeps tests valid with a temporary XDG_CONFIG_HOME.
63 for marker in ("../", "~/.config", "~/.local", "~/."):
64 if marker in code:
65 errors.append(f"{rel}: non-self-contained path marker {marker!r}")
67 for match in re.finditer(r'Qt\.resolvedUrl\("([^"]+)"\)', code):
68 target = match.group(1)
69 if target != "nugu.json":
70 errors.append(f"{rel}: unresolved local resource {target!r}; add it to audit inventory if intentional")
72 if 'Quickshell.env("HOME")' in code and rel.as_posix() != "Theme.qml":
73 errors.append(f"{rel}: HOME path access belongs in Theme.qml unless explicitly audited")
5575palette = config_dir / "nugu.json"
5676generated = repo_dir / "hypr" / "generated" / "nugu.json"
5777if not palette.exists():
125145print("PASS nugu quickshell audit")
126146print(f"qml_files={len(qml_files)}")
147print("required_files=" + ",".join(required_files))
127148if detected:
128149 print("external_commands=" + ",".join(command for command, _reason in detected))
129150for warning in warnings: