Contemporary laptop (lithium-ion) batteries come with a bevy of guidance on extending their lifespan. The usage advice is particularly frustrating. You’re not supposed to drain them below ~3%, but you’re also not supposed to leave them at 100% for extended periods.
In other words, you can’t leave the laptop plugged in to the AC all the time, but you also can’t wait until it is too low before plugging it in. Trying to plug and unplug the laptop manually is difficult at best (if you have nothing better to do than to sit around and watch the battery level, then you may as well just turn it off and do something else altogether).
Is there some way to use software to automate and maximize the battery’s lifespan? For example, plug in the laptop, and configure it to charge as normal until it is ~95% full, then programmatically switch to battery mode until it is ~5% then programmatically switch back to AC?