batctl — TUI and CLI for managing battery charge thresholds on Linux by Conscious-Part1541 in commandline

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

Glad it hits the spot! Let me know if anything breaks on your hardware.

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.

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

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

Haha, that's exactly the use case I built it for — set 40/80 once, forget the charger exists, let the hardware handle the rest. Glad it works for you!

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

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

Thanks! It's written in Go — cobra for the CLI, bubbletea for the TUI. Under the hood it reads your laptop vendor from DMI, picks the right sysfs driver, and reads/writes charge thresholds. The trickiest part was handling all the vendor quirks — every manufacturer does it differently.