In this tutorial we will see how to adjust charge threshold of a laptop/notebook battery under a system running Ubuntu 12.10/12.04/Linux Mint 13 or older. This will help you set when you want to start and stop battery charging when the laptop is connected to AC power. This is useful for extending battery life of your laptop, but keep in mind that this will reduce runtime.
Note: This tutorial is applicable mainly for Lenovo's ThinkPad laptops and notebooks.
To get information about your laptop battery, run this command:
sudo apt-get install tp-smapi-dkms
To check if the module is well loaded, run this command:
lsmod | grep tp_smapi
To set when charge threshold start, run this command:
echo 60 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
Replace 60 with any other battery level percentage of your choice.
To set when charge threshold stops, run this command:
echo 95 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
In the two commands given above, battery charge threshold will start at 60% and stop at 95%. You can set your own battery threshold percentages depending on the battery size you have and for how long you want to use your laptop.
To run the commands given above automatically at system startup, edit the rc.local file with this command:
sudo gedit /etc/rc.local
For Linux Mint:
sudo pluma /etc/rc.local
And enter the two commands at the end of the file just above "exit 0", then save and close:
Note: This tutorial may not work with all laptops. If you have something to add, please use the comment form listed below.