I've got a laptop (Lenovo T460s) with two built-in batteries. Generally, Linux (via Ubuntu 16.04) handles them well; I see a battery life-left indicator in the status bar that tells me how much is left over the two of them. For example, if one battery is dead but the other is alive, it shows 50%. What it doesn't do is successfully transition between the batteries when one dies. If I'm running the laptop and not plugged in, and the indicator hits 50% (meaning the current battery is dead), the laptop dies and goes off. I can power on again, and the laptop successfully finds the second battery and happily runs from there.
How can I configure my system to not die when the first battery runs out?