I am trying to preserve long-term battery life by capping my laptop's charging behavior so that the battery doesn't go beyond 80% (or maybe 60) charged. I've been reading several posts and threads, but have not found an ideal solution for my setup yet. I think I've found one here (/sys/class/power_supply/BAT0/charge_...), but want to get some expert advice before I start changing file contents around in this directory.
What do the following files do?
- charge_control_end_threshold
- charge_control_start_threshold
- charge_start_threshold
- charge_stop_threshold
I have used the cat command to see their contents on my laptop, and they are as follows:
:~$ cat /sys/class/power_supply/BAT0/charge_control_end_threshold
100
:~$ cat /sys/class/power_supply/BAT0/charge_control_start_threshold
0
:~$ cat /sys/class/power_supply/BAT0/charge_start_threshold
0
:~$ cat /sys/class/power_supply/BAT0/charge_stop_threshold
100
:~$
If I change the first or last file contents from 100 to 80 (or 60), will the battery stop charging at 80%? What else would happen--anything bad, weird, or unexpected?
(if it's useful I'm using: OS: Ubuntu 24.04 LTS. Model: Lenovo ThinkPad X13 Gen 4. Processor: AMD Ryzen™ 7 PRO 7840U. Kernal: Linux 6.8.0-31-generic)