🔺 For cellphones 🔺
To set up adaptive battery charging on Ubuntu, you can check if your laptop supports charge thresholds by running specific commands in the terminal. If supported, you can manually configure the battery charge limits using commands to set the start and end charging thresholds, or you can wait for future updates in GNOME that may provide a graphical interface for this feature.
Setting Up Adaptive Battery Charging on Ubuntu
Adaptive battery charging helps prolong the lifespan of your laptop’s battery by limiting the maximum charge level. Here’s how to set it up on Ubuntu.
Check Laptop Compatibility
- Open Terminal: Press
Ctrl + Alt + T. - List Power Supply: Run the command:
ls /sys/class/power_supply/- Look for your battery, usually named
BAT0,BAT1, etc. - Check Support: Run:
ls /sys/class/power_supply/BAT0- Replace
BAT0with your battery name. Look for files namedcharge_control_start_thresholdandcharge_control_end_threshold. If they exist, your laptop supports charge limiting.
Set Charge Limits
- Set Start Charging Level: To limit charging to 80%, run:
sudo sh -c "echo 80 > /sys/class/power_supply/BAT0/charge_control_start_threshold"Set Maximum Charge Level: To stop charging at 90%, run:
sudo sh -c "echo 90 > /sys/class/power_supply/BAT0/charge_control_end_threshold"Make Changes Permanent
To ensure these settings persist after reboot:
- Create a Systemd Service: Open terminal and run:
sudo nano /etc/systemd/system/battery-charge.serviceAdd the Following Lines:
[Unit]
Description=Set Battery Charge Maximum Limit
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'echo 90 > /sys/class/power_supply/BAT0/charge_control_end_threshold'
[Install]
WantedBy=multi-user.targetEnable the Service:
sudo systemctl enable battery-charge.serviceConclusion
After following these steps, your Ubuntu laptop will limit battery charging, helping to maintain battery health over time.



Watch the Series.

Watch the Series.