fix(power): #60 name-agnostic system-battery scan
All checks were successful
Check / eval (push) Successful in 2m53s

Replace BAT* globs with type=Battery + !scope=Device (same filter as
nomarchy-battery-notify) in charge-limit oneshot, menu gates, Waybar
power-profile self-gate, doctor, and install chassis detection. CMB0-
style names get charge-cap and laptop modules consistently.

V3 pending: confirm on non-BAT* hardware (HARDWARE-QUEUE). Close #60.

Verified: V1 (option-docs, hardware-db-modules, battery-charge-limit VM).
This commit is contained in:
Bernardo Magri
2026-07-10 08:32:24 +01:00
parent 09388196a9
commit c962d07841
9 changed files with 80 additions and 29 deletions

View File

@@ -95,15 +95,6 @@ the WiFi card.” Does **not** rewrite the flake unless a later `--apply`
is explicitly designed. Cost: extract script + package + man/README
pointer; V0V1.
### 60. Battery / powerprofile: name-agnostic battery scan
`power.nix` oneshot and menu/waybar globs use
`/sys/class/power_supply/BAT*`. `nomarchy-battery-notify` correctly
treats any system battery (`type=Battery`, not `scope=Device`). Machines
with `CMB0` (and similar) get notify but not charge-cap / inconsistent
gating. Fix: name-agnostic scan aligned with battery-notify. Cost:
small multi-file; `[blocked:hw]` only to confirm on non-BAT* hardware —
logic still ships at V1.
### 63. Generated Waybar: identity-bar affordances (powermenu + logo)
Whole-swap bars ship `custom/powermenu` and a left logo → main menu; the
generated `waybar.nix` bar has neither. Optional parity add for
@@ -151,7 +142,7 @@ Still PROPOSED for later triage: first-boot tips (partially shipped via
Custom…) writing `settings.power.batteryChargeLimit` — but that's a
baked NixOS option, so it only lands on the next `sys-rebuild`. To make
it instant (no rebuild): add a udev rule making
`/sys/class/power_supply/BAT*/charge_control_end_threshold`
system-battery `charge_control_end_threshold` nodes
group-writable (`MODE`/`GROUP`) so the menu can `echo N >` it live
alongside persisting state (the sysfs oneshot in power.nix still owns
boot + AC-replug re-apply), and/or surface a rofi-menu quick row or a
@@ -181,7 +172,8 @@ Still PROPOSED for later triage: first-boot tips (partially shipped via
_(Waybar doctor indicator, Control Center appearance no-ops, summer-day
scroll → #51; neon-glass broken waybar → **fixed** 2026-07-09 by quarantine
(removed `waybar.css` → generated bar; render-confirmed).)_
_(Battery charge-limit / powerprofile BAT*-only → **#60**.)_
_(Battery charge-limit / powerprofile BAT*-only → **#60** ✓ 2026-07-10;
V3 pending on non-BAT* hardware.)_
### Docs / option-surface drift (codebase exam 2026-07-09)
@@ -456,7 +448,7 @@ NVIDIA depth) is still mostly CLI. Items below are product work on top
of that doc — design notes live there (§4§10).*
_(`nomarchy-detect-hw` CLI → **#58**; Fingerprint menu → **#55**;
Installer NVIDIA commented guidance → **#59**.)_
Installer NVIDIA commented guidance → **#59** ✓ 2026-07-10.)_
_(hardware-db ∈ nixos-hardware → #49; usbutils on install PATH → #50;
i2c README table → #48.)_

View File

@@ -8,6 +8,12 @@ the failure as a NOW bug in BACKLOG.md. Machines: the **AMD dev box**
QA machine), the **T14s** (webcam case).
## Any machine (dev box is fine)
- [ ] **#60 non-BAT* battery name (if available)** — on a machine whose
system battery is **not** named `BAT*` (e.g. `CMB0`): confirm
charge-limit oneshot writes the threshold, System Battery limit
and Power profile rows appear, Waybar power-profile module shows,
doctor charge-limit section runs. On `BAT0`-only machines this is
a no-op (already covered by existing charge-limit re-apply item).
- [ ] **btop theme fidelity (#52 residual)** — softGL theme-shot cannot
open Ghostty, so the hand `btop.theme` assets were only guest-file
asserted (main_bg / inactive_fg keys) + desktop/bar rendered for

View File

@@ -17,6 +17,19 @@ Template:
---
## 2026-07-10 — #60 name-agnostic system-battery scan
- **Task:** NEXT #60 — align charge-limit / menu / waybar / doctor /
installer chassis with battery-notifys type=Battery + !scope=Device
filter (BAT* globs miss CMB0).
- **Did:** power.nix oneshot, rofi helpers (`has_system_battery` /
`has_charge_threshold`), waybar powerprofile gate, doctor loop,
hardware-db chassis, options.nix description. HARDWARE-QUEUE entry
for non-BAT* confirm. Closed #60.
- **Verified:** **V1**`checks.option-docs`, `hardware-db-modules`,
`battery-charge-limit` (VM) green; no remaining `BAT*` globs in code
paths. **V3 pending:** non-BAT* name on real hardware (queue entry).
- **Next suggestion:** #63 generated Waybar powermenu + logo.
## 2026-07-10 — #59 NVIDIA commented system.nix guidance
- **Task:** NEXT #59 — when `common-gpu-nvidia` is selected, emit
commented PRIME/power/open-module guidance in installer-generated