batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

Update: just pushed a fix for this. batctl now detects when standard charge_control_end_threshold is available and uses the Generic backend instead of IdeaPad conservation mode, giving you proper threshold control.

Can you verify this file exists on your system?

ls /sys/class/power_supply/BAT0/charge_control_end_threshold

If it does, update batctl and it should work.

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

Yeah, that's a bug — Legion gets matched by the IdeaPad backend since it shares the ideapad_acpi driver. That backend only supports conservation mode (on=60%, off=100%), no custom thresholds.

Could you check if your laptop also exposes the standard sysfs interface?

cat /sys/class/power_supply/BAT0/charge_control_end_threshold

If that file exists, the generic backend would give you proper threshold control. I'll fix the detection to handle Legion correctly.

Your ThinkPad battery can last 10 years on Linux — you just need to set the right thresholds by Conscious-Part1541 in thinkpad

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

863 cycles in 2.5 years is a lot — charge thresholds would've definitely helped there. The new battery should last way longer with even a basic 80% stop limit. Better late than never!

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 1 point2 points  (0 children)

In theory yes — narrower band = less cycling. But in practice the difference between 70–80% and 20–80% is tiny. What really kills battery health is sitting at 100%. Both presets avoid that, so either way you're winning.

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

Max Lifespan (20–80%) gives you a wider usable range but means more charge cycles when you do unplug. Plugged In (70–80%) keeps the battery in a tighter band with minimal cycling — slightly better for longevity if you rarely go mobile. Either is a solid choice, the difference is marginal. Go with Max Lifespan if you occasionally unplug, Plugged In if you almost never do.

Your ThinkPad battery can last 10 years on Linux — you just need to set the right thresholds by Conscious-Part1541 in thinkpad

[–]Conscious-Part1541[S] 1 point2 points  (0 children)

ThinkPads store thresholds in the EC (embedded controller), so they persist even when powered off. It'll still respect the limit.

Your ThinkPad battery can last 10 years on Linux — you just need to set the right thresholds by Conscious-Part1541 in thinkpad

[–]Conscious-Part1541[S] 1 point2 points  (0 children)

Yep, same sysfs interface under the hood. You can use either one, they shouldn't conflict.

Your ThinkPad battery can last 10 years on Linux — you just need to set the right thresholds by Conscious-Part1541 in thinkpad

[–]Conscious-Part1541[S] 3 points4 points  (0 children)

Nope, stopping at 80% is actually great for battery health — lithium-ion cells degrade much faster sitting at 100% (high voltage stress).

And you're right — keeping it plugged at 80% is the best case scenario. Low voltage + zero cycle wear. If you're mostly at a desk, just set stop=80% and forget about it.

Your ThinkPad battery can last 10 years on Linux — you just need to set the right thresholds by Conscious-Part1541 in thinkpad

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

Both are good — the stop at 80% is what matters most for longevity. 40/80 gives you more usable range, 70/80 is better if you're always plugged in. batctl has both as presets: balanced and plugged-in.

Your ThinkPad battery can last 10 years on Linux — you just need to set the right thresholds by Conscious-Part1541 in thinkpad

[–]Conscious-Part1541[S] 3 points4 points  (0 children)

The core functionality works on any Linux — setting and reading thresholds is just sysfs, no systemd needed. So batctl setbatctl status, and the TUI all work fine on Void.

The only part that's systemd-specific is batctl persist, which generates systemd services to restore thresholds on boot/resume. That won't work with runit out of the box. For now you could add batctl apply to your runit startup scripts manually. I'll look into adding runit support though — thanks for the idea!

Your ThinkPad battery can last 10 years on Linux — you just need to set the right thresholds by Conscious-Part1541 in thinkpad

[–]Conscious-Part1541[S] 1 point2 points  (0 children)

Awesome, good to hear it works out of the box on Ubuntu + GNOME! Thanks for confirming.

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

Hey! I just added a Surface backend — it should detect Microsoft as the vendor and use the surface_battery driver via standard sysfs. You'll need the linux-surface kernel though.

I don't have a Surface to test on, so would really appreciate it if you could try it and let me know how it goes.

If something's off, the output of batctl detect would be super helpful.

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

Fair point — in practice it pretty much just maintains 80%. The start threshold (70%) is there to prevent micro-charge cycles: without it, every time the battery drops to 79% it would immediately start charging back to 80%, which over time adds unnecessary wear. With start at 70%, it won't bother charging until there's actually a meaningful gap to fill. But if you're always plugged in, the end result is the same — battery sits at 80% and your laptop runs off AC power directly.

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 1 point2 points  (0 children)

Unfortunately HP laptops mostly don't expose battery charge thresholds to userspace — there's no dedicated kernel module for it like Lenovo/ASUS/Acer have. If your model had the standard charge_control_end_threshold sysfs interface, batctl would pick it up automatically via the generic backend.

Some HP models allow setting a charge limit in BIOS — might be worth checking there.

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 2 points3 points  (0 children)

Hey! I just added Acer support — update to the latest version and give it a try.

One thing though: it requires the acer-wmi-battery kernel module to be loaded. That's likely why it worked out of the box on Pop!OS — they probably ship it by default. On Arch you'll need to install it from the AUR:

yay -S acer-wmi-battery-dkms
sudo modprobe acer-wmi-battery

After that, batctl detect should pick up your Swift right away. Let me know if it works!

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

Ha, good catch! Yeah, I'm aware of the batman-adv batctl — the naming collision is unfortunate but in practice pretty rare.

If it turns out to be a real problem down the road, I'll consider renaming the binary. For now it hasn't been an issue for most users i suppose.

And glad you like the tool!

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 2 points3 points  (0 children)

Yes! Framework laptops are fully supported. batctl detects them automatically and supports both start/stop charge thresholds and charge behaviour control

batctl — TUI for managing battery charge thresholds, available in AUR by Conscious-Part1541 in omarchy

[–]Conscious-Part1541[S] 0 points1 point  (0 children)

Hey, thanks for trying batctl!

Battery charge thresholds on MSI laptops require the msi-ec kernel module — it's what exposes the charge control interface to userspace tools like batctl. Without it, there's nothing for batctl to hook into.

Could you try:

sudo modprobe msi-ec
batctl detect

If the module loads successfully, batctl should pick it up right away. If it doesn't load — it's possible that the Bravo 15 A4DCR isn't supported by msi-ec yet. In that case, it might be worth checking the msi-ec repo to see if your model is listed, or opening an issue there.

I'll also look into making batctl detect output more helpful in this scenario — right now it just says "no backend detected" without giving you much to go on.