Thinkpad (Dual battery)
Capability
- 3 presets: Full Capacity Mode, Balance Mode, and Maximum Life Span mode.
- Default threshold values of these 3 preset modes are set at 100/95%, 80/75%, and 60/55%.
- Each preset end threshold value can be customized between 100-80 %, 80-65 %, and 85-50 % respectively.
- Each preset start threshold value can be customized between is 95-75 %, 85-60 %, and 85-40 % respectively.
- The difference between end and start threshold cannot be less than 5%.
Dependencies
- Thinkpad legacy depend on a kernel modules
tp_smapi. tp_smapimay be available as a package by your distro’s package-manager- Addition information about
tp_smapiis available here: https://github.com/linux-thinkpad/tp_smapi
tp_smapi module is supported by a third party and this extension/author is not in any way responsible for the kernel module installation, bugs or damages.
Testing charging threshold using command-line
After installing tp_smapi below sysfs path will be available and charging threshold/mode can be changed. Now user will be able to set charging threshold, using commandline and test charging behavior. Charging mode can be set by using echo command in terminal.
For example:
To apply threshold on secondary battery (BAT1) with start threshold value of 55, end threshold value of 60, command would be.
Require root privileges
echo '55' | pkexec tee /sys/devices/platform/smapi/BAT1/start_charge_thresh
echo '60' | pkexec tee /sys/devices/platform/smapi/BAT1/stop_charge_thresh
sudo also can be used in place of pkexec in the above commands as both sudo and pkexec can be use to run commands in root mode. To make use of polkit rules, the extension uses pkexec.
The current threshold value can also be read using cat command in terminal.
cat /sys/devices/platform/smapi/BAT0/start_charge_thresh
cat /sys/devices/platform/smapi/BAT0/stop_charge_thresh
If charging threshold are applied successfully using above commands, the extension is compatible.
Condition for applying threshold
- Accepted values for
stop_charge_thresh: 6 - 100- Accepted values for
start_charge_thresh: 2 - 96stop_charge_thresh > start_charge_threshstop_charge_thresh - start_charge_thresh = 4
The sequence of applying threshold in command-line matters, as in whether to set
stop_charge_threshfirst or the applystop_charge_threshfirst.
The conditionstop_charge_thresh > start_charge_threshmust be fulfilled in order for charging threshold to apply. Threshold values will not be accepted ifstart_charge_threshis less thanstop_charge_threshFor example 1: Increase threshold
Laptops current threshold value is:
start_charge_thresh = 75stop_charge_thresh = 80User want to apply new threshold value of:
start_charge_thresh = 95stop_charge_thresh = 100Incorrect sequence
echo '95' | pkexec tee /sys/class/power_supply/BAT0/start_charge_thresh echo '100' | pkexec tee /sys/class/power_supply/BAT0/stop_charge_threshSince start_threshold is applied first
stop_charge_thresh (80)is less thanstart_charge_thresh (95), so the conditionstop_charge_thresh > start_charge_threshis not fulfilled, hencestart_charge_threshwont be updated.Correct sequence
echo '100' | pkexec tee /sys/class/power_supply/BAT0/stop_charge_thresh echo '95' | pkexec tee /sys/class/power_supply/BAT0/start_charge_threshSince end_threshold is applied first,
stop_charge_thresh (100)is greater thanstart_charge_thresh (75), so the conditionstop_charge_thresh > start_charge_threshis fulfilled.For example 2: Decrease threshold
Laptops current threshold value is:
start_charge_thresh = 75stop_charge_thresh = 80User want to apply new threshold value of:
start_charge_thresh = 55stop_charge_thresh = 60Incorrect sequence
echo '60' | pkexec tee /sys/class/power_supply/BAT0/stop_charge_thresh echo '55' | pkexec tee /sys/class/power_supply/BAT0/start_charge_threshSince end_threshold is applied first,
stop_charge_thresh (60)is less thanstart_charge_thresh (75), hence the conditionstop_charge_thresh > start_charge_threshis not fulfilled. Sostop_charge_threshwont be updated.Correct sequence
echo '55' | pkexec tee /sys/class/power_supply/BAT0/start_charge_thresh echo '60' | pkexec tee /sys/class/power_supply/BAT0/stop_charge_threshSince start_threshold is applied first,
stop_charge_thresh (80)is greater thanstart_charge_thresh (55), so the conditionstop_charge_thresh > start_charge_threshis fulfilled.
Quick Settings

Extension Preferences