Repository navigation
Cap charging at 80% from the Power Panel #10431
iamteedoh
started this conversation in
Suggestions
Replies: 3 comments
|
Adding this thread here since it's related but nothing ever progressed with that so this should still be a valid request/discussion: #627 (comment) |
0 replies
|
+1 for this. Hardware data point in case it helps whichever implementation lands:
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The power panel already reads charge-start-threshold and charge-end-threshold, and switches to "Charge limit / Holding" when a cap is active. There is no way to set one. Today that means editing sysfs by hand or installing TLP.
I added a CHARGE LIMIT section with two buttons, 80% and Full.
The part worth discussing is that nothing in the UI runs as root. The button writes a small config file, a systemd
.pathunit notices the change, and a privileged oneshot applies it tocharge_control_*. No polkit action, no password prompt, no setuid helper, and the panel never touches sysfs itself.Persistence needs hooks because the thresholds live in EC firmware rather than kernel memory: a udev rule for boot and hotplug, and the unit for resume. I also re-assert on a timer, which is belt and braces rather than something I can point at a specific failure for.
It has been running on my machine for a day. Happy to open a PR if there is interest, or to hear if you would rather solve the privilege hop a different way.
All reactions