Limit Battery Charging to 80% via sysfs

Write charge_control_end_threshold in /sys/class/power_supply/BAT0/ to stop charging early and extend battery lifespan.

LinuxlaptopPower & SleephealthbatteryMedium risk
Run `echo 80 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold` to stop charging at 80%.

01Command

Command
$ echo 80 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold

02What it does

Lithium batteries age fastest when kept at 100% and warm, so capping the charge at 80% is the single most effective lifespan tweak for a laptop that lives on the charger. Check what your hardware exposes with `ls /sys/class/power_supply/BAT0/` — ThinkPads use separate charge_start_threshold and charge_stop_threshold files instead. The setting resets after reboot unless you persist it with a systemd service or the GNOME Power Profiles/KDE Battery-peak UI.

03Risk

RiskMedium risk
RequirementsHardware/firmware support: works out of the box on many ASUS, LG, Huawei and Samsung laptops (charge_control_end_threshold in sysfs). ThinkPads expose /sys/class/power_supply/BAT0/charge_start_threshold and charge_stop_threshold; GNOME users of KDE Plasma 5.25+ or ASUS Linux tools offer GUI equivalents.
!Warning: Not all laptops support thresholds: if the file does not exist, writing it is impossible and third-party hacks will not create it — check the ArchWiki vendor list first.

04Undo

Undo
$ echo 100 | sudo tee /sys/class/power_supply/BAT0/charge_control_end_threshold

05Sources

  • sysfs-class-power - kernel documentation
    kernel.org · community · 2026-09-17
    Evidence: Documents charge_control_end_threshold and charge_stop_threshold files in /sys/class/power_supply/<battery>/, which limit the maximum charge level to reduce battery wear.
  • Laptop - ArchWiki
    Arch Linux Wiki · technical · 2026-09-17
    Evidence: The Battery section explains battery charge threshold support per vendor and how to write to /sys/class/power_supply/BAT*/charge_control_end_threshold or ThinkPad-specific start/stop threshold files.

Last verified: 2026-09-18 · Category: System & Settings