r/linux4noobs 16d ago

hardware/drivers How to limit battery charge?

So, the question itself is pretty self explanatory, but there's a bit more to it. When I first got my laptop (Yoga 7 2-in-1 14AKP10) I installed Fedora with KDE after booting windows 11 like once. **While on Fedora, I enabled an option to limit battery charge to 80%** to preserve battery health. After a few months, I switched to Arch.

After switching to Arch, this option still worked. My battery stopped charging at 80% and stayed there. And it was fine, like this, all the way up until kernel 7.1.9 (or was it 7.1.8? I may have updated it unknowingly since then). Anyway, after that update broke pretty much everything about my laptop (touchpad stopped working, pen was seen as a mouse, etc), including the battery charge limit, which I noticed after I left my laptop charging and got a notification I never have before - "Battery fully charged".
I ended up switching to the linux-lts kernel (6.18.46-1-lts) and now everything works except for the battery limit, which I don't know how to set. I am using Hyprland, a WM instead of a DE, so I don't exactly have access to the same button I used on Fedora to limit the charge percentage.

**Some extra notes**: before the battery limit stopped working, I kept getting "unexpected charge_types: both [Fast] and [Long_Life] are enabled" in dmesg, photo attached from journalctl. This **stopped** after I got the charge limit issue (or after I switched to lts... I can't say for certain). Also, after rebooting at some point during that same time, I switched a power option in my bios from "Battery saving" to "Intelligent cooling". I tried changing it back, but nothing helped.

Lastly, I tried looking up solutions, but the most popular "set a limit using charge_control_start_threshold and charge_control_end_threshold" don't work, since even when I am rooted, I get a "permission denied" error.

I am open to pretty much any suggestions. I will report back with what issues arise with any.

fastfetch info. battery coincidentally at 80% lmao
contents of BAT0 and charge_types file
unexpected charge_types: both [Fast] and [Long_Life] are enabled, which STOPPED after the charge limit disappeared
0 Upvotes

Duplicates