feat(display): per-profile workspace→output pins (item 15c)
All checks were successful
Check / eval (push) Successful in 3m0s
Lock bump / bump (push) Successful in 2m53s

A display profile can now pin workspaces to outputs:

  docked = {
    monitors   = [ … ];
    workspaces = { "1" = "DP-3"; "9" = "eDP-1"; };
  };

The bare list-of-monitors shape still works (either-type; hyprland.nix
normalizes — coercedTo refuses list-of-submodule sources). Pins bake as
Hyprland `workspace` rules from the active profile and apply instantly
on `nomarchy-display-profile apply`: keyword sets the session rule,
moveworkspacetomonitor moves open workspaces over. Pins from a
previously applied profile linger in-session until reload/rebuild
(hyprctl can only add) — inert if the output is absent, noted in the
applier.

V1: flake check green (checks.display-profiles now asserts
workspaceRule) + scratch-downstream eval: baked settings carry both
rule sets, the generated applier has the keyword+dispatch pairs
(bash -n), match/list correct with mixed shapes. V3 queued in
HARDWARE-QUEUE (rides the dock test). Item 15 complete — deleted.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-07-05 23:09:14 +01:00
parent 096440a7d7
commit edd0bd38ce
9 changed files with 121 additions and 62 deletions

View File

@@ -201,43 +201,6 @@ label `nix-kvm`), then an agent uncomments the workflow's `vm-checks`
job: the `checks.*` VM suite + real toplevel/HM builds on every push
(also upgrades item 14's bump gate from eval-only to the full suite).
### 15. Display profiles — docked/undocked switching
ROADMAP § Display / monitor management, remaining: profile switching of
the *same* outputs. **Plan (designed 2026-07-05, iteration #27):**
- **Option:** `nomarchy.displayProfiles` (HM) = `attrsOf (listOf
monitorType)` — each profile is a named list reusing the existing
monitor submodule verbatim (no second schema). Example: `docked =
[ { name="eDP-1"; resolution="disable"; } { name="DP-3"; … } ]`.
- **State:** `settings.displayProfile = "<name>"` (absent = base
config), menu-written with `--no-switch` — the night-light pattern:
instant now, baked at the next rebuild. Add the key to
nomarchy-theme-sync's known-settings list (item 11's validator warns
on unknowns).
- **Rebuild overlay** (hyprland.nix): active profile's entries replace
base `nomarchy.monitors` entries whole, by name; the existing
`settings.monitors` resolution overlay then applies field-level on
top, EXCEPT onto entries whose profile resolution = "disable" (a
stale resolution pick must not resurrect a disabled panel).
- **Instant apply** (menu): System Display gains a self-gated
"Profile: <active>" row (only when profiles are declared) → pick →
`hyprctl keyword monitor <rule>` per entry (rules baked into the
dispatcher at build, like everything else in rofi.nix) + state write
+ toast. Outputs the profile doesn't name keep their base rules.
- **Slices:** (a) ✓ shipped 2026-07-05 (iteration #28): option +
overlay (pure `modules/home/monitor-rules.nix`, unit-tested by
checks.display-profiles) + `nomarchy-display-profile` applier + menu
Profiles row + template example — V3 (real dock) queued; (b) ✓
shipped 2026-07-05 (iteration #29): hotplug auto-switch — `match`
subcommand (exact set, else unambiguous largest subset, ties =
none) + a poll watcher (exec-once, the keyboard-watcher pattern)
gated live on `settings.displayProfileAuto` (a separate boolean,
NOT an "auto" pseudo-profile, so auto-picks persist concrete
profiles that rebuilds bake) + menu Auto-switch row — V3 rides the
slice-a dock test; (c) optional per-profile
`workspaces = { "1" = "DP-3"; }` → Hyprland `workspace` keywords.
- **Non-goals:** no kanshi (fights Hyprland's output management —
decided in ROADMAP), nwg-displays stays a find-the-values helper.
### 18. "nomarchy" control center + first-boot welcome `[big]`
ROADMAP § control center. A single front-end over the common toggles on
the same `nomarchy-theme-sync` surface, + a first-boot guided