Commit 05f062bb7c00
Changed files (2)
docs
superpowers
docs/superpowers/plans/2026-10-07-kyushu-display-control.md
@@ -1,86 +0,0 @@
-# Kyushu Display Control Implementation Plan
-
-> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
-
-**Goal:** Add a Kyushu-only Raffi display menu that dynamically manages left/right extension, single-target laptop mirroring, and output power.
-
-**Architecture:** A shell helper performs validation, Niri IPC positioning, and managed `wl-mirror` lifecycle control. A Raffi script filter discovers connected external DRM outputs and emits actions for the helper. Kyushu installs `wl-mirror` and disables Kanshi; shared Niri configuration remains usable by Aomi.
-
-**Tech Stack:** Nix/Home Manager, Bash, `niri msg`, `wl-mirror`, systemd user units, Raffi, jq.
-
-## Global Constraints
-
-- Apply display-control behavior only to Kyushu.
-- Keep Aomi's shared Kanshi configuration working.
-- Use `eDP-*` as the mirror source and dynamically enumerate connected non-eDP DRM outputs.
-- Do not alter non-selected external outputs.
-- Use one named user mirror unit; never use broad `pkill` cleanup.
-- Do not commit unless explicitly requested.
-
----
-
-## File structure
-
-- Modify `systems/kyushu/home.nix`: disable Kanshi.
-- Modify `imperative/kyushu/bootstrap.sh`: install Fedora-native `wl-mirror`.
-- Modify `home/common/desktop/sway/swayidle.nix`: make Kanshi wake restart safe when absent or disabled.
-- Create `dots/config/raffi/scripts/niri-display`: validate and perform named display actions.
-- Create `dots/config/raffi/scripts/niri-display-raffi`: enumerate external targets and emit Raffi JSON.
-- Modify `dots/config/raffi/raffi.yaml`: add the Kyushu Raffi filter entry.
-
-### Task 1: Host ownership and dependency configuration
-
-**Files:**
-- Modify: `systems/kyushu/home.nix`
-- Modify: `home/common/desktop/sway/swayidle.nix`
-
-**Produces:** Kyushu has a Fedora-native `wl-mirror` and no Kanshi service; other hosts retain their configured Kanshi behavior.
-
-- [ ] Add `services.kanshi.enable = false;` in Kyushu’s Home Manager module and add `wl-mirror` to the Kyushu bootstrap's native DNF package list.
-- [ ] Replace `systemctl --user restart kanshi` with `systemctl --user try-restart kanshi` in the common Niri power-on script.
-- [ ] Evaluate Kyushu’s Home Manager config and evaluate Aomi’s configuration to ensure both remain valid.
-
-### Task 2: Display action helper
-
-**Files:**
-- Create: `dots/config/raffi/scripts/niri-display`
-
-**Consumes:** `niri msg --json outputs`, `/sys/class/drm/*/status`, `systemctl --user`, `wl-mirror`.
-
-**Produces:** `niri-display {extend-left|extend-right|mirror|enable|disable} OUTPUT`.
-
-- [ ] Write the helper with strict Bash mode and functions to discover a connected eDP output, verify a selected external DRM connector, obtain each enabled output’s logical width, and stop the named mirror unit.
-- [ ] For `extend-right`, set eDP to `0,0` and target to eDP logical width, `0`.
-- [ ] For `extend-left`, set target to `0,0` and eDP to target logical width, `0`.
-- [ ] For `mirror`, apply the requested position, stop the existing named unit, then launch `wl-mirror` in a named systemd user scope targeting the selected output.
-- [ ] For `disable`, stop the mirror when relevant then power off only the selected output. For `enable`, power on only the selected output.
-- [ ] Run shellcheck and manually exercise helper argument validation and Niri JSON parsing without changing output state.
-
-### Task 3: Raffi action discovery
-
-**Files:**
-- Create: `dots/config/raffi/scripts/niri-display-raffi`
-- Modify: `dots/config/raffi/raffi.yaml`
-
-**Consumes:** Niri output JSON, connected DRM output names, and `niri-display` action interface.
-
-**Produces:** A `display` Raffi filter that emits left, right, mirror, enable, and disable entries per external connector.
-
-- [ ] Write the script filter using the existing Alfred-style JSON convention.
-- [ ] Join Niri’s enabled-output metadata with connected DRM connector names, exclude the eDP source, and display connector plus model/resolution when available.
-- [ ] Emit arguments in a safely parseable `ACTION:OUTPUT` format and filter titles/subtitles by Raffi’s query input.
-- [ ] Emit an explanatory zero-results item when no eDP source or external targets are present.
-- [ ] Add one Raffi script-filter entry whose action invokes `niri-display {value}`.
-- [ ] Run the script directly and validate its JSON with jq for the current HDMI target.
-
-### Task 4: End-to-end verification
-
-**Files:**
-- Verify: all files above
-
-- [ ] Run `shellcheck` on both new scripts.
-- [ ] Run the appropriate Kyushu Home Manager build/evaluation without switching configuration.
-- [ ] Test `extend-right` and `extend-left` with the connected HDMI display and inspect `niri msg --json outputs` positions.
-- [ ] Test `mirror`, verify the named user unit is running and `wl-mirror` is fullscreen on the chosen output, then test cleanup by switching to extend mode.
-- [ ] Test disable then enable for HDMI, confirming no mirror unit remains after disable.
-- [ ] Confirm no unrequested files changed with `git diff --check` and `git status --short`.
docs/superpowers/specs/2026-10-07-kyushu-display-control-design.md
@@ -1,43 +0,0 @@
-# Kyushu Display Control Design
-
-## Goal
-
-Provide a Kyushu-only Raffi menu to arrange the laptop panel and any currently connected external Niri outputs, and mirror the laptop panel to one chosen external output.
-
-## Decisions
-
-- Kyushu uses explicit manual display control; disable Kanshi on that host only.
-- Keep shared Kanshi configuration intact because Aomi uses its `aomi` profile.
-- The source for mirroring is the connected `eDP-*` laptop panel.
-- Discover target displays dynamically rather than hard-code `HDMI-A-1`.
-- Actions affect only the chosen external output and the laptop panel; all other external outputs remain unchanged.
-- Only one `wl-mirror` mirror session may run. Starting a new mirror stops the prior managed session.
-- Offer per-output extend-left, extend-right, mirror, enable, and disable actions.
-- Run the mirror in a named user systemd unit, so cleanup is exact rather than process-name based.
-
-## Architecture
-
-A Kyushu-specific `niri-display` helper invokes Niri IPC, discovers current outputs from Niri JSON and DRM connector state, and manages a `wl-mirror` user unit. `wl-mirror` is installed as a Fedora-native package by the Kyushu bootstrap so it uses the host Mesa/EGL driver stack. A Raffi script filter renders one action item per external display and dispatches the selected action to the helper.
-
-Enabled-output metadata comes from `niri msg --json outputs`. DRM `/sys/class/drm/card*-*/status` provides connector names for connected outputs which are currently disabled by Niri, allowing the menu to expose an enable action. The helper validates a connected eDP source and chosen connected external target before acting.
-
-## Layout semantics
-
-For an external target with logical width `target_width` and eDP source with logical width `edp_width`:
-
-- Extend right: eDP at `0,0`; target at `edp_width,0`.
-- Extend left: target at `0,0`; eDP at `target_width,0`.
-- Mirror uses the chosen placement then starts `wl-mirror eDP --fullscreen-output target --fullscreen`.
-
-The mirror is a fullscreen client, not compositor-level output cloning. Aspect-ratio differences are handled by `wl-mirror` fitting the source image.
-
-## Error handling
-
-- The Raffi list reports when no eDP source or no external connector is available.
-- The helper exits non-zero with an actionable error when Niri cannot be contacted, the source is absent, or a target is disconnected.
-- `disable` stops the managed mirror first when its target matches.
-- `enable` only enables the selected output; it preserves its layout and does not start mirroring.
-
-## Verification
-
-Build the Kyushu Home Manager configuration. With an HDMI display connected, test left/right extension, mirror start, switching mirror targets, disable, re-enable, and cable-disconnected errors. Confirm Kanshi remains enabled in Aomi's generated configuration and disabled in Kyushu's.