Linux command line scripts to limit Dell laptop charge level.
Laptop battery life can be prolonged by limiting the charge level to 80%. E.g when plugged into AC for long periods.
Tested on:
- Dell XPS 13 9360
- Ubuntu 20.04
- Dell Command | Configure 4.3
- Dell Vostro 10 3510
- Ubuntu 20.04
- Dell Command | Configure 4.7
- Dell XPS 17 9720
- Ubuntu 23.10
- Dell Command | Configure 4.11.0
It's possible to set a charge limit in the BIOS, however it's inconvenient to have to reboot to charge the level e.g when a full charge is required.
The Dell Command Config tool provides a way to adjust the charge limit via command line, I’ve wrapped up these commands into a simple bash script to make them easy and quick to run.
Download pre-compiled .deb from: https://www.dell.com/support/article/en-uk/sln311302/dell-command-configure?lang=en
git clone https://github.com/glynhudson/dell-charge-limit
cd dell-charge-limit
./battery-charge-longlife.sh
./battery-charge-full.sh
‘Adaptive’ will result in a full 100% charge, but I think may reduce this charge level if plugged in for a long period.
In my experience the setting is persistent over reboots, as expected since we’re adjusting a BIOS setting.