feat(control-center): battery charge-limit as a preset toggle
All checks were successful
Check / eval (push) Successful in 3m10s
All checks were successful
Check / eval (push) Successful in 3m10s
The "Battery Limit" entry was a raw number prompt; make it a proper toggle picker — Off / 80% (recommended) / 90% / 60% / Custom… — writing settings.power.batteryChargeLimit. Kept in the control-center, where the baked rebuild-valued System Toggles live (the rofi nomarchy-menu is the instant surface; the CC holds config values), and reachable from the menu via System › Control Center. Base machinery (the sysfs oneshot + AC-replug udev in power.nix) is unchanged, so it lands on the next sys-rebuild like its siblings. Instant-effect (no rebuild) is refiled in BACKLOG § PROPOSED as [blocked:hw]: it needs a udev-writable threshold node, confirmable only on a laptop with the control. Verified: V0 (bash -n; nix flake check --no-build, green) + V1 (nomarchy-control-center package builds — the writeShellApplication shellcheck gate passes). Session spot-check queued in HARDWARE-QUEUE. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -247,22 +247,20 @@ job: the `checks.*` VM suite + real toplevel/HM builds on every push
|
|||||||
*Agents: append here with a one-paragraph pitch (what/why/cost). Do not
|
*Agents: append here with a one-paragraph pitch (what/why/cost). Do not
|
||||||
implement. Bernardo moves accepted items into a tier.*
|
implement. Bernardo moves accepted items into a tier.*
|
||||||
|
|
||||||
- **Battery charge-limit as a quick toggle** (Raised by Bernardo,
|
- **Battery charge-limit — make the toggle instant** `[blocked:hw]`
|
||||||
2026-07-07). The base already ships: `nomarchy.system.power.
|
(follow-up to the preset toggle shipped 2026-07-07, iteration #55).
|
||||||
batteryChargeLimit` writes `charge_control_end_threshold` via a
|
The control-center now has a proper toggle (Off / 80% / 90% / 60% /
|
||||||
systemd service (+ a udev re-trigger on AC plug), with a "Battery
|
Custom…) writing `settings.power.batteryChargeLimit` — but that's a
|
||||||
Limit" control-center entry and a `battery-charge-limit` VM check.
|
baked NixOS option, so it only lands on the next `sys-rebuild`. To make
|
||||||
The gap is UX: today it's a *type-a-number* NixOS option that needs a
|
it instant (no rebuild): add a udev rule making
|
||||||
`sys-rebuild` to change. Bernardo wants a **toggle** for the charging
|
`/sys/class/power_supply/BAT*/charge_control_end_threshold`
|
||||||
threshold — i.e. a one-click "conservation mode" (cap ~80% ↔ full
|
group-writable (`MODE`/`GROUP`) so the menu can `echo N >` it live
|
||||||
100%) rather than entering a value. Ideally instant-effect: the
|
alongside persisting state (the sysfs oneshot in power.nix still owns
|
||||||
service already `echo`es the threshold to sysfs, so a toggle could
|
boot + AC-replug re-apply), and/or surface a rofi-menu quick row or a
|
||||||
write the live value + persist to `settings.power.batteryChargeLimit`
|
Waybar action. `[blocked:hw]`: the sysfs write + no-rebuild effect can
|
||||||
(night-light `--no-switch` pattern) instead of rebuilding, and
|
only be confirmed on a laptop exposing the threshold. Decide first
|
||||||
surface it prominently (menu row and/or a Waybar quick action).
|
whether the small privilege grant (a local user can set the charge cap)
|
||||||
Decide: keep the number-entry for the exact cap AND add an on/off
|
is acceptable.
|
||||||
quick toggle, or replace with a fixed-cap toggle. Cost: small — mostly
|
|
||||||
a menu/writer + making the write instant; the sysfs mechanism exists.
|
|
||||||
|
|
||||||
- **Portal/Flatpak camera picker still lists the internal IR sensor**
|
- **Portal/Flatpak camera picker still lists the internal IR sensor**
|
||||||
(ROADMAP § Webcam follow-up). The shipped IR-hide is a *WirePlumber
|
(ROADMAP § Webcam follow-up). The shipped IR-hide is a *WirePlumber
|
||||||
|
|||||||
@@ -222,6 +222,13 @@ QA machine), the **T14s** (webcam case).
|
|||||||
draining. (Crossing logic VM-verified — this checks the real
|
draining. (Crossing logic VM-verified — this checks the real
|
||||||
swaync rendering in a session.)
|
swaync rendering in a session.)
|
||||||
|
|
||||||
|
- [ ] **Battery charge-limit toggle** (iteration #55) — control-center
|
||||||
|
(menu › System › Control Center › System Toggles › Battery Limit):
|
||||||
|
the preset picker (Off / 80% / 90% / 60% / Custom…) writes the value
|
||||||
|
(`nomarchy-theme-sync get settings.power.batteryChargeLimit` reflects
|
||||||
|
the pick); after a `sys-rebuild` the sysfs
|
||||||
|
`charge_control_end_threshold` reads it. (UX-only over the already
|
||||||
|
VM-verified writer — a session sanity pass, not a deep check.)
|
||||||
- [ ] **Waybar hides under fullscreen video** (item 30) — after
|
- [ ] **Waybar hides under fullscreen video** (item 30) — after
|
||||||
`home-update` + relogin, put a browser video (YouTube) into
|
`home-update` + relogin, put a browser video (YouTube) into
|
||||||
fullscreen (F): the bar is now *covered* by the video, not drawn
|
fullscreen (F): the bar is now *covered* by the video, not drawn
|
||||||
|
|||||||
@@ -17,6 +17,27 @@ Template:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## 2026-07-07 — Battery charge-limit quick toggle (iteration #55)
|
||||||
|
- **Task:** BACKLOG PROPOSED (promoted by Bernardo) — a toggle for the
|
||||||
|
battery charge threshold.
|
||||||
|
- **Did:** Replaced the control-center "Battery Limit" raw number-prompt
|
||||||
|
with a preset toggle picker (Off / 80% recommended / 90% / 60% /
|
||||||
|
Custom…) writing `settings.power.batteryChargeLimit`. Kept it in the
|
||||||
|
control-center — that's where the baked, rebuild-valued System Toggles
|
||||||
|
live (rofi `nomarchy-menu` is the *instant* surface; the CC holds
|
||||||
|
config values); it's reachable from the menu via System › Control
|
||||||
|
Center. Base machinery (sysfs oneshot + AC-replug udev in power.nix)
|
||||||
|
untouched.
|
||||||
|
- **Verified:** V0 (`bash -n`; `nix flake check --no-build`, green) + V1
|
||||||
|
(nomarchy-control-center package builds → the writeShellApplication
|
||||||
|
shellcheck gate passes).
|
||||||
|
- **Pending:** instant-effect (no rebuild) refiled in PROPOSED as
|
||||||
|
`[blocked:hw]` — needs a udev-writable sysfs node, confirmable only on
|
||||||
|
a laptop with the charge-threshold control. Light session spot-check
|
||||||
|
queued in HARDWARE-QUEUE.
|
||||||
|
- **Next suggestion:** item 29 is `[human]`/`[blocked:hw]`; remaining is
|
||||||
|
item 28 slices or a QA sweep.
|
||||||
|
|
||||||
## 2026-07-07 — Waybar overlaps fullscreen video (iteration #54)
|
## 2026-07-07 — Waybar overlaps fullscreen video (iteration #54)
|
||||||
- **Task:** BACKLOG item 30 — bar drawn on top of a fullscreen YouTube video.
|
- **Task:** BACKLOG item 30 — bar drawn on top of a fullscreen YouTube video.
|
||||||
- **Did:** `layer: top` → `bottom` in the generated `waybar.nix` and the
|
- **Did:** `layer: top` → `bottom` in the generated `waybar.nix` and the
|
||||||
|
|||||||
@@ -167,12 +167,33 @@ function toggles_menu() {
|
|||||||
sleep 1
|
sleep 1
|
||||||
;;
|
;;
|
||||||
"Battery Limit")
|
"Battery Limit")
|
||||||
limit=$(gum input --prompt "Enter battery charge limit % (or empty for default): " --placeholder "$(get_state settings.power.batteryChargeLimit)")
|
# Conservation-mode toggle: cap charging to spare the battery,
|
||||||
|
# or Off to charge full. A preset picker (not a raw number) with
|
||||||
|
# a Custom escape hatch. This is a baked NixOS system option
|
||||||
|
# (settings.power.batteryChargeLimit → the sysfs oneshot in
|
||||||
|
# power.nix), so it lands on the next sys-rebuild like the other
|
||||||
|
# System Toggles.
|
||||||
|
cur=$(get_state settings.power.batteryChargeLimit)
|
||||||
|
sel=$(gum choose --header "Battery charge limit (now: ${cur:-default})" \
|
||||||
|
"80% (recommended)" "90%" "60%" "Off (charge to 100%)" "Custom…" "Cancel")
|
||||||
|
case "$sel" in
|
||||||
|
"80%"*) set_state "settings.power.batteryChargeLimit" "80"
|
||||||
|
echo "Charge limit set to 80% (requires rebuild)." ;;
|
||||||
|
"90%") set_state "settings.power.batteryChargeLimit" "90"
|
||||||
|
echo "Charge limit set to 90% (requires rebuild)." ;;
|
||||||
|
"60%") set_state "settings.power.batteryChargeLimit" "60"
|
||||||
|
echo "Charge limit set to 60% (requires rebuild)." ;;
|
||||||
|
"Off"*) set_state "settings.power.batteryChargeLimit" "null"
|
||||||
|
echo "Charge limit off — charges to 100% (requires rebuild)." ;;
|
||||||
|
"Custom…")
|
||||||
|
limit=$(gum input --prompt "Charge limit % (50–100): " --placeholder "$cur")
|
||||||
if [ -n "$limit" ]; then
|
if [ -n "$limit" ]; then
|
||||||
set_state "settings.power.batteryChargeLimit" "$limit"
|
set_state "settings.power.batteryChargeLimit" "$limit"
|
||||||
else
|
echo "Charge limit set to $limit% (requires rebuild)."
|
||||||
set_state "settings.power.batteryChargeLimit" "null"
|
fi ;;
|
||||||
fi
|
*) : ;;
|
||||||
|
esac
|
||||||
|
sleep 1
|
||||||
;;
|
;;
|
||||||
"Bluetooth")
|
"Bluetooth")
|
||||||
cur=$(get_state "settings.bluetooth.enable")
|
cur=$(get_state "settings.bluetooth.enable")
|
||||||
|
|||||||
Reference in New Issue
Block a user