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_smapi
may be available as a package by your distro’s package-manager- Addition information about
tp_smapi
is 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_thresh
stop_charge_thresh - start_charge_thresh = 4
The sequence of applying threshold in command-line matters, as in whether to set
stop_charge_thresh
first or the applystop_charge_thresh
first.
The conditionstop_charge_thresh > start_charge_thresh
must be fulfilled in order for charging threshold to apply. Threshold values will not be accepted ifstart_charge_thresh
is less thanstop_charge_thresh
For example 1: Increase threshold
Laptops current threshold value is:
start_charge_thresh = 75
stop_charge_thresh = 80
User want to apply new threshold value of:
start_charge_thresh = 95
stop_charge_thresh = 100
Incorrect sequence
echo '95' | pkexec tee /sys/class/power_supply/BAT0/start_charge_thresh echo '100' | pkexec tee /sys/class/power_supply/BAT0/stop_charge_thresh
Since start_threshold is applied first
stop_charge_thresh (80)
is less thanstart_charge_thresh (95)
, so the conditionstop_charge_thresh > start_charge_thresh
is not fulfilled, hencestart_charge_thresh
wont 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_thresh
Since end_threshold is applied first,
stop_charge_thresh (100)
is greater thanstart_charge_thresh (75)
, so the conditionstop_charge_thresh > start_charge_thresh
is fulfilled.For example 2: Decrease threshold
Laptops current threshold value is:
start_charge_thresh = 75
stop_charge_thresh = 80
User want to apply new threshold value of:
start_charge_thresh = 55
stop_charge_thresh = 60
Incorrect sequence
echo '60' | pkexec tee /sys/class/power_supply/BAT0/stop_charge_thresh echo '55' | pkexec tee /sys/class/power_supply/BAT0/start_charge_thresh
Since end_threshold is applied first,
stop_charge_thresh (60)
is less thanstart_charge_thresh (75)
, hence the conditionstop_charge_thresh > start_charge_thresh
is not fulfilled. Sostop_charge_thresh
wont 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_thresh
Since start_threshold is applied first,
stop_charge_thresh (80)
is greater thanstart_charge_thresh (55)
, so the conditionstop_charge_thresh > start_charge_thresh
is fulfilled.
Quick Settings
Extension Preferences