repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

feat(quickshell): verify nugu theme auto mode

9c3ca2647e1561b54a85cc4b7d64abdac1303c39

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (5)

docs/super/inventory/2026-06-17-quickshell-theme-auto-verification.md

Added
new file mode 100644
1 +# Quickshell Nugu theme auto verification
3 +Date: 2026-06-17
5 +## Scope
7 +Verify the self-contained Quickshell Nugu theme can switch dark/light and return to automatic mode by reading Nugu's shared mode cache.
9 +No live services were linked, started, stopped, disabled, or retired.
11 +## Changes verified
13 +- `setThemeMode auto` now reloads from `~/.cache/nugu/mode`.
14 +- `quickshell/nugu/smoke.sh` runs with a temporary `HOME`, `XDG_CONFIG_HOME`, and temp `~/.cache/nugu/mode`.
15 +- Status warning/critical items use semantic signal colors as pill fills with readable `content.backdrop` text. This avoids the light-mode warning text contrast failure without forking the Nugu palette.
17 +## Commands
19 +```sh
20 +cd /home/oli/Workspace/dotfiles
21 +quickshell/nugu/smoke.sh
22 +```
24 +Observed:
26 +```text
27 +PASS nugu quickshell scaffold smoke
28 +initial={"theme":"dark","diagnostics":false,"bar":false,"nativeNotifications":false,"launcher":false,"clipboardPicker":false,"powerMenu":false,"pendingPower":"","lastOsd":"","lastPower":""}
29 +open={"theme":"light","diagnostics":true,"bar":true,"nativeNotifications":false,"launcher":false,"clipboardPicker":false,"powerMenu":false,"pendingPower":"","lastOsd":"","lastPower":""}
30 +auto_light=light
31 +after_reload=dark
32 +hidden={"theme":"dark","diagnostics":false,"bar":false,"nativeNotifications":false,"launcher":false,"clipboardPicker":false,"powerMenu":false,"pendingPower":"","lastOsd":"","lastPower":""}
33 +smoke_exit=0
34 +--- lingering qs ---
35 +```
37 +No lingering `qs` process remained.
39 +## Contrast check
41 +Checked the actual status-item foreground/background pairs from `quickshell/nugu/nugu.json` with WCAG contrast math.
43 +All checked pairs passed >= 4.5:1:
45 +- default status text
46 +- muted status text
47 +- active status fill
48 +- hover status fill
49 +- critical status fill
50 +- warning status fill
51 +- info signal text
53 +Light warning text over `ui.backdrop` would be 3.98:1, so Quickshell does not render warning status as bare text in that state.
55 +## Boundary
57 +Still not complete for the overall migration:
59 +- `quickshell.service` remains not live.
60 +- Ironbar/Mako remain active.
61 +- Hypr binds still reference old companion tools until live parity is approved.

quickshell/nugu/README.md

Modified
37 37 qs ipc -c nugu call nugu reloadTheme
38 38 qs ipc -c nugu call nugu setThemeMode light
39 39 qs ipc -c nugu call nugu setThemeMode dark
40 +qs ipc -c nugu call nugu setThemeMode auto
40 41 qs ipc -c nugu call nugu scaffoldState
41 42 qs ipc -c nugu call nugu hideAll
44 -`scaffoldState` returns a compact JSON string for smoke tests. `hideAll` closes
45 -all Quickshell-owned surfaces and disables the opt-in native notification loader;
46 -it does not touch Ironbar, Mako, Hyprland, or user services.
45 +`setThemeMode light|dark` previews a mode without writing global state.
46 +`setThemeMode auto` follows `~/.cache/nugu/mode` again. `scaffoldState` returns
47 +a compact JSON string for smoke tests. `hideAll` closes all Quickshell-owned
48 +surfaces and disables the opt-in native notification loader; it does not touch
49 +Ironbar, Mako, Hyprland, or user services.
48 51 ## Phase 2A bar IPC

quickshell/nugu/StatusItem.qml

Modified
17 17 signal wheelUp()
18 18 signal wheelDown()
20 - // Shared status primitive keeps hover/active/error semantics identical across
21 - // Phase 2B widgets and prevents one-off colors from drifting away from Nugu.
20 + // Shared status primitive keeps hover/active/signal semantics identical across
21 + // widgets and prevents one-off colors from drifting away from Nugu. Warning
22 + // and critical states use Nugu signal colors as fills because light-mode
23 + // warning text over ui.backdrop is below WCAG AA contrast.
22 24 implicitWidth: Math.max(minWidth, label.implicitWidth + 14)
23 25 implicitHeight: 22
24 26 visible: text.length > 0
26 28 Rectangle {
27 29 anchors.fill: parent
28 30 radius: 7
29 - color: root.active ? root.theme.ui.focus : (mouse.containsMouse ? root.theme.ui.accent : "transparent")
31 + color: root.active
32 + ? root.theme.ui.focus
33 + : (mouse.containsMouse
34 + ? root.theme.ui.accent
35 + : (root.critical ? root.theme.error : (root.warning ? root.theme.warning : "transparent")))
32 38 Text {
33 39 id: label
34 40 anchors.centerIn: parent
35 41 text: root.text
36 - color: root.active || mouse.containsMouse
42 + color: root.active || mouse.containsMouse || root.critical || root.warning
37 43 ? root.theme.content.backdrop
38 - : (root.critical ? root.theme.error : (root.warning ? root.theme.warning : (root.muted ? root.theme.ui.minor : root.theme.ui.normal)))
44 + : (root.muted ? root.theme.ui.minor : root.theme.ui.normal)
39 45 font.family: "IBM Plex Mono"
40 46 font.pixelSize: 12
41 47 font.features: { "tnum": 1 }

quickshell/nugu/Theme.qml

Modified
85 85 function setMode(next: string): void {
86 - applyMode(next)
86 + // `auto` means follow Nugu's shared mode cache again. Dark/light are
87 + // preview overrides only; they never write global desktop state.
88 + if (next === "auto") reload()
89 + else applyMode(next)
89 92 function fallbackDark() {

quickshell/nugu/smoke.sh

Modified
11 11 config_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
12 12 repo_dir=$(CDPATH= cd -- "$config_dir/../.." && pwd -P)
13 13 tmp=${TMPDIR:-/tmp}/nugu-qs-smoke.$$
14 +home_tmp=$tmp/home
14 15 log_out=${NUGU_QS_SMOKE_OUT:-/tmp/nugu-qs-smoke.out}
15 16 log_err=${NUGU_QS_SMOKE_ERR:-/tmp/nugu-qs-smoke.err}
16 17 qs_pid=
36 37 ipc() {
37 - XDG_CONFIG_HOME="$tmp" qs ipc -c nugu call nugu "$@"
38 + HOME="$home_tmp" XDG_CONFIG_HOME="$tmp" qs ipc -c nugu call nugu "$@"
40 41 assert_contains() {
47 48 esac
50 -mkdir -p "$tmp/quickshell"
51 +mkdir -p "$tmp/quickshell" "$home_tmp/.cache/nugu"
52 +printf 'dark' >"$home_tmp/.cache/nugu/mode"
51 53 ln -s "$config_dir" "$tmp/quickshell/nugu"
52 54 : >"$log_out"
53 55 : >"$log_err"
55 57 cd "$repo_dir"
56 -XDG_CONFIG_HOME="$tmp" QS_NO_RELOAD_POPUP=1 qs -c nugu >"$log_out" 2>"$log_err" &
58 +HOME="$home_tmp" XDG_CONFIG_HOME="$tmp" QS_NO_RELOAD_POPUP=1 qs -c nugu >"$log_out" 2>"$log_err" &
57 59 qs_pid=$!
58 60 sleep 4
72 74 assert_contains "$state_open" '"bar":true' open-state
73 75 assert_contains "$state_open" '"nativeNotifications":false' open-state
77 +printf 'light' >"$home_tmp/.cache/nugu/mode"
78 +mode_auto_light=$(ipc setThemeMode auto)
79 +assert_contains "$mode_auto_light" 'light' theme-auto-light
81 +printf 'dark' >"$home_tmp/.cache/nugu/mode"
75 82 ipc reloadTheme >/dev/null
76 83 mode_after_reload=$(ipc themeMode)
77 84 assert_contains "$mode_after_reload" 'dark' theme-reload
95 102 printf 'PASS nugu quickshell scaffold smoke\n'
96 103 printf 'initial=%s\n' "$state_initial"
97 104 printf 'open=%s\n' "$state_open"
105 +printf 'auto_light=%s\n' "$mode_auto_light"
98 106 printf 'after_reload=%s\n' "$mode_after_reload"
99 107 printf 'hidden=%s\n' "$state_hidden"