feat(audio,menu): dock audio auto-follow watcher + docked Display/Audio menu rows
Some checks failed
Check / eval (push) Failing after 1m41s

Bernardo's dock test (the #87 V3): audio stayed on EasyEffects→speakers.
Root cause, established live: WirePlumber's stored default
(default-nodes state, written by any past explicit pick) outranks the
priority.session rules, so #87 alone can never move the default on a
real machine; EasyEffects 8 follows the default device (kcfg default
true, verified by watching its output links). Fix: nomarchy-dock-audio
(modules/home/dock-audio.nix, nomarchy.dockAudio.enable, default on) —
a pactl-subscribe watcher that set-default-sinks new dock-class sinks
(regex data imported from modules/nixos/dock-audio-rules.nix, single
source) with a toast, plus a startup sweep for login-while-docked that
never overrides a manual in-dock pick. Unplug falls back by priority.

Menus: Display gains docked rows — "Laptop screen off · everything →
<ext>" (live-only disable; a persisted one could black-screen an
undocked boot), "Screen on · <name>", "Move workspace · → next
monitor", "Swap workspaces" (exactly-2 gate); Audio gains a self-gated
"Send output → <dock sink>" quick row. All self-gate on real outputs.

Verified: V2-equivalent on live hardware (no dock available) — watcher
followed a fake dock-named null sink and fell back on unload, control
run without the watcher stayed pinned (proving the stored-default
diagnosis), EE output links moved mid-playback; generated menu bash -n
green, dock-row jq exercised on real pactl JSON, dispatchers probed on
live Hyprland; flake check + option-docs + template-sot green.
V3 pending: real-dock retest ×2 in HARDWARE-QUEUE (watcher keys on
new-sink events; pre-existing nodes that only flip route availability
would need the queued diagnosis data).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-12 14:22:49 +01:00
parent 9e37e11915
commit 6439105d38
9 changed files with 243 additions and 8 deletions

View File

@@ -19,13 +19,35 @@ the **T14s** (webcam case).
— should suspend as usual. Optional: with a docked display-profile
(`eDP-1` disable), confirm clamshell layout still looks right after
lid close. Pass = no surprise suspend when docked.
- [ ] **#87 dock audio sink follow** — V2 asserts WirePlumber
`90-nomarchy-dock-audio` rules (HDMI/USB priority). On a laptop
with HDMI or USB-dock audio: play sound on speakers, plug external
audio → default sink should move to HDMI/dock (`wpctl status` shows
`*` on the external sink); unplug → `*` returns to built-in.
Manual `wpctl set-default` still works; Bluetooth may outrank dock
(by design). Pass = auto switch without menu intervention.
- [ ] **#87 round 2: dock audio auto-follow (watcher)** — round 1 result
(Newton, 2026-07-12): audio stayed on speakers when docking; the
running generation had no `90-nomarchy-dock-audio` rules yet, and
live testing showed the priority rules alone can never win anyway —
WirePlumber's stored default (`default-nodes` state, written by any
past explicit pick) outranks `priority.session`, and this machine
(like most) has one. Fix shipped: the `nomarchy-dock-audio` user
service `pactl set-default-sink`s dock-class sinks on hotplug;
EasyEffects follows the default (verified live: EE's output links
moved to a fake dock-named null sink mid-playback). Retest after
pull+rebuild+home on ≥ this rev: play audio, plug the dock →
toast "Audio → <monitor/dock>" and sound moves with EE effects
still active; unplug → sound returns to speakers; while docked,
picking speakers in the Audio menu sticks until the next replug.
If it does NOT switch, capture for diagnosis: `pactl subscribe`
output during the plug, `pactl --format=json list sinks` while
docked (sink names may not match the dock regexes, or the sink
node may pre-exist and only flip route availability — the watcher
keys on new-sink events).
- [ ] **Docked display/audio menu rows** (2026-07-12) — with a real
external monitor: Display menu shows "Laptop screen off ·
everything → <ext>" (only with >1 active output), "Screen on ·
<name>" after a disable, "Move workspace · → next monitor", "Swap
workspaces" (exactly 2 outputs). Laptop-off must move its
workspaces to the external; Screen on restores it (preferred/auto —
declared scale/pos return at the next relogin/switch). Audio menu
shows "Send output → <dock sink>" when one exists and isn't
default; picking it moves output + toasts. Pass = rows appear/act
as described, and none of them show on a single-display session.
- [ ] **#55 fingerprint enroll on real reader** — with
`nomarchy.hardware.fingerprint.enable` and a physical reader: System
Fingerprint Enroll a finger; List shows it; Verify succeeds; optional

View File

@@ -19,6 +19,30 @@ Template:
---
## 2026-07-12 — dock audio auto-follow + docked menu rows (interactive)
- **Task:** Bernardo's dock test (= #87's V3): audio stayed on speakers,
had to hand-tweak EasyEffects; wants docked Display/Audio menu options.
- **Did:** Root-caused live on Newton: WirePlumber's stored default
(default-nodes) outranks the #87 priority rules (control test: new
sink, no watcher → default pinned), and the running gen lacked the
rules anyway; EE 8 follows the default fine (kcfg default true +
observed links move). Shipped `modules/home/dock-audio.nix`
(`nomarchy.dockAudio.enable`, on): pactl-subscribe watcher
set-default-sinks new dock-class sinks (regexes imported from
dock-audio-rules.nix) + toast + startup sweep. Menu: Display gains
laptop-off/screen-on/move-workspace/swap rows (live-only keywords);
Audio gains self-gated "Send output → <dock sink>" row.
- **Verified:** V2-equivalent live on Newton — watcher: fake dock-named
null sink → default followed, unplug → fell back, EE links moved
mid-playback (pw-link); menu: generated script bash -n, dock-row jq
exercised against real pactl JSON, dispatchers probed on live
Hyprland. flake check green; option-docs green. Beware: kill the
subscribe pipe by PID — pkill -f self-matches the test shell.
- **Pending:** real-dock V3 ×2 in HARDWARE-QUEUE (watcher may miss
sinks that pre-exist and only flip route availability — capture pactl
subscribe + sink JSON if it fails again).
- **Next suggestion:** #89 slice 3 (Signal pixmap) or dock V3 feedback.
## 2026-07-12 — auto-commit sweep before pull/rebuild/home (interactive)
- **Task:** Bernardo's request (no BACKLOG item): with autoCommit on,
hand edits to `~/.nomarchy` (his had 4) stayed forever-dirty —