If you're a tinkerer, I'd seriously recommend using something like ACC (Advanced Charging Controller). It'll automatically cut your charge off at ~80% and slow the charging if it's heating up too much. Should greatly extend the service life of your battery. You can pretty much just install with Magisk and forget it. Perhaps it's too late for your current phone/battery but maybe on the next one.
On normal Linux, if your device has a proper PMIC with a driver that allows this, you can just change the max charging voltage to something like 4.1V or less via sysfs (/sys/class/power_supply/*) on each boot. You can do the same for maximum charging current, to avoid so called "fast charging", and charge at 0.2C for example. And that's it.
https://github.com/VR-25/acc
Pair with something like AccuBattery for visibility into battery capacity over time.