repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

test(quickshell): inventory external commands

9943a988665838650794934f269d772ca30f490d

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

+61 / −6 text lines

Diff layout

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

Modified

+3 / −0 text lines

1919 - `hyprlauncher`
2020 - `hyprshutdown`
2121 - `hyprctl notify`
22- external executable dependencies are inventoried and unknown direct process-launch commands fail the audit.
2223- transitional bridges are explicitly reported as warnings, not hidden:
2324 - `cliphist`
2425 - `makoctl`
4041```text
4142PASS nugu quickshell audit
4243qml_files=29
44external_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
4345WARN transitional external bridge still present: cliphist
4446WARN transitional external bridge still present: makoctl
4547PASS nugu quickshell scaffold smoke
4648PASS nugu quickshell audit
4749qml_files=29
50external_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
4851WARN transitional external bridge still present: cliphist
4952WARN transitional external bridge still present: makoctl
5053smoke_exit=0

quickshell/nugu/audit.sh

Modified

+58 / −6 text lines

1717errors = []
1818warnings = []
1919qml_files = sorted(config_dir.glob("*.qml"))
20code_by_file = {}
2122if not qml_files:
2223 errors.append("no QML files found")
4647 for line in lines:
4748 code_lines.append(line.split("//", 1)[0])
4849 code = "\n".join(code_lines)
50 code_by_file[rel] = code
4951 for forbidden in ("hyprlauncher", "hyprshutdown", "hyprctl notify"):
5052 if forbidden in code:
5153 errors.append(f"{rel}: executable dependency on retired companion marker {forbidden!r}")
5759elif generated.exists() and palette.read_text() != generated.read_text():
5860 errors.append("quickshell/nugu/nugu.json differs from hypr/generated/nugu.json")
60# These are known transitional bridges, not hidden dependencies. Keep them
61# visible so they cannot be mistaken for final parity.
62all_code = "\n".join(p.read_text() for p in qml_files)
63for command in ("cliphist", "makoctl"):
64 if command in all_code:
65 warnings.append(f"transitional external bridge still present: {command}")
62# Keep executable dependencies explicit. Quickshell can replace companion UI,
63# but system/session CLIs still exist at command boundaries until later parity
64# phases remove or validate them. Unknown commands fail so new dependencies do
65# not sneak into the self-contained config.
66all_code = "\n".join(code_by_file.values())
67external_commands = {
68 "awk": "approved parser in shell snippet",
69 "brightnessctl": "approved brightness backend",
70 "cliphist": "transitional clipboard storage bridge",
71 "cut": "approved parser in shell snippet",
72 "grep": "approved parser in shell snippet",
73 "head": "approved parser in shell snippet",
74 "hyprctl": "approved Hyprland control until bind migration",
75 "hyprlock": "approved session lock backend",
76 "hyprpicker": "approved color picker backend",
77 "hyprshot": "approved screenshot backend",
78 "iwctl": "approved iwd status backend",
79 "loginctl": "approved session lock helper",
80 "makoctl": "transitional notification bridge",
81 "nu": "approved terminal TUI shell",
82 "playerctl": "approved MPRIS action helper",
83 "satty": "approved screenshot annotation backend",
84 "sed": "approved parser in shell snippet",
85 "sh": "approved shell boundary for existing command pipelines",
86 "systemctl": "approved gated power/session backend",
87 "upower": "approved battery TUI backend",
88 "uptime": "approved status backend",
89 "uwsm": "approved session app launcher",
90 "wezterm": "approved terminal launcher",
91 "wl-copy": "approved clipboard output backend",
92 "wpctl": "approved PipeWire action helper",
93}
95detected = []
96for command, reason in sorted(external_commands.items()):
97 if re.search(rf"(?<![A-Za-z0-9_-]){re.escape(command)}(?![A-Za-z0-9_-])", all_code):
98 detected.append((command, reason))
99 if reason.startswith("transitional"):
100 warnings.append(f"transitional external bridge still present: {command}")
102# This catches direct process-launch array heads that are not in the approved
103# inventory. Shell snippets launched through `sh -c` are inventoried by known
104# command names above; they remain explicit but are too free-form for a safe
105# generic parser.
106launch_patterns = (
107 r'\.exec\(\["([A-Za-z0-9_.+-]+)"',
108 r'detached\(\["([A-Za-z0-9_.+-]+)"',
109 r'\.command\s*=\s*\["([A-Za-z0-9_.+-]+)"',
110)
111for pattern in launch_patterns:
112 for match in re.finditer(pattern, all_code):
113 candidate = match.group(1)
114 if candidate not in external_commands:
115 errors.append(f"unknown direct external command {candidate!r}; add it to audit inventory with a reason or remove it")
67117if errors:
68118 print("FAIL nugu quickshell audit")
75125print("PASS nugu quickshell audit")
76126print(f"qml_files={len(qml_files)}")
127if detected:
128 print("external_commands=" + ",".join(command for command, _reason in detected))
77129for warning in warnings:
78130 print(f"WARN {warning}")
79131PY