How to Stop Battery Charging at 80% on RHEL/Rocky Linux

 

Keeping your laptop battery charged at 100% all the time can slowly reduce its lifespan. If you use Rocky Linux and want to stop charging at 80% (a commonly recommended limit), this guide walks you through everything step by step in a beginner-friendly way.


Why Limit Battery Charging to 80%?

Modern laptops use lithium-ion batteries, which age faster when:

  • They are kept at 100% charge for long periods

  • The laptop stays plugged in all day

By limiting charging to around 80%, you can:

  • Reduce battery wear

  • Extend battery lifespan

  • Keep the battery healthier over the long term

This is especially useful for office users and people who mostly work while plugged in.


Step 1: Check If Your Laptop Supports Charge Limiting

Battery charge limiting depends on hardware support. Many business-class laptops support it, but not all.

Run the following command:

ls /sys/class/power_supply/BAT0/

If you see files like:

  • charge_control_end_threshold

  • charge_control_start_threshold

✅ Your laptop supports battery charge limiting in Linux.

If you do not see these files, skip to the section "What If My Laptop Does Not Support This?".


Step 2: Set Battery Charging Limit to 80% (Temporary)

If the file exists, you can immediately stop charging at 80%.

Run:

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

Notes:

  • Charging will stop once the battery reaches 80%

  • This setting resets after reboot

To verify:

cat /sys/class/power_supply/BAT0/charge_control_end_threshold

You should see:

80

Step 3: Make the 80% Limit Permanent (Recommended)

To ensure the limit applies automatically after every reboot, create a systemd service.

3.1 Create the service file

sudo vi /etc/systemd/system/battery-charge-limit.service

Paste the following content:

[Unit]
Description=Set battery charge limit
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/bin/bash -c "echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold"

[Install]
WantedBy=multi-user.target

Save and exit the editor.


3.2 Enable and start the service

sudo systemctl daemon-reload
sudo systemctl enable battery-charge-limit.service
sudo systemctl start battery-charge-limit.service

3.3 Verify after reboot

cat /sys/class/power_supply/BAT0/charge_control_end_threshold

If it shows 80, the setup is complete 🎉


ThinkPad Users: Use TLP (Best Option)

Lenovo ThinkPads have excellent Linux support through TLP.

Install and enable TLP

sudo dnf install tlp tlp-rdw
sudo systemctl enable tlp --now

Configure charge thresholds

Edit the config file:

sudo vi /etc/tlp.conf

Set:

START_CHARGE_THRESH_BAT0=75
STOP_CHARGE_THRESH_BAT0=80

Apply the configuration:

sudo tlp start

What If My Laptop Does Not Support This?

If the file charge_control_end_threshold does not exist, then:

❌ Linux cannot control battery charging on your hardware
❌ No kernel or software workaround exists

What you can do instead:

  • Dell / HP / Lenovo: Check BIOS / UEFI battery settings

  • ASUS: Usually supported only via Windows utilities

  • Generic laptops: No charge-limiting support


Common Laptop Support Summary

Laptop BrandLinux Support
     Lenovo ThinkPad     Excellent (TLP)
Dell Latitude / PrecisionBIOS / limited sysfs
HP EliteBookBIOS only
ASUSMostly Windows-only
Consumer laptopsOften unsupported

Final Thoughts

If your laptop supports battery charge limiting, setting an 80% cap is one of the simplest ways to protect battery health.

For laptops that don’t support it, BIOS settings are the only safe alternative.


Quick Tip

If you mostly use your laptop plugged in:

  • Enable 80% charging

  • Occasionally discharge to ~30–40%

  • Avoid leaving it at 100% for days

This small habit can significantly extend battery life over time.


Happy Linux tuning! 🐧

Comments

Popular posts from this blog

Mount NTFS formatted drive on RHEL

Create a Bridge interface on Linux Host running RHEL/Rocky Linux