Optimize Battery Health: How to Set Charge Thresholds for ASUS Laptops on Linux Made Easy
Asus Battery Health Charging Script for Linux
Author: @sakibulalikhan
Asus laptops come with a built-in feature called Asus Battery Health Charging, which is often part of the MyAsus application. This feature allows users to set a charging threshold (typically 60%) when their laptop is connected to AC power. Keeping the battery charge at 60% helps mitigate heating issues, improves performance, and significantly prolongs the overall lifespan of the laptop battery.
Unfortunately, this feature is only available on Windows operating systems, leaving Linux users—including those on Ubuntu, Linux Mint, Elementary OS, Pop OS, Fedora, Arch, and others—without official support. This lack of support can discourage users from switching to Linux despite its performance advantages.
Fortunately, there is a solution! This script provides Linux users with the ability to implement battery charging thresholds, making Asus Battery Health Charging available across multiple Linux distributions.
The script has been tested on various Linux distributions, including Ubuntu, Linux Mint, PopOS, Elementary OS, Zorin OS, Fedora, AlmaLinux, Rocky Linux, Arch, Manjaro, and EndoverOS.
Usage
To use the script, run the following command in your terminal:
abh [-t <charge_threshold>] [-r] [-v] [-h]
┏┓ ┳┓ ┓┏ ┓ ┓
┣┫┏┓┏┏ ┣┫┏┓╋╋┏┓┏┓┓┏ ┣┫┏┓┏┓┃╋┣┓
┛┗┛┗┻┛ ┻┛┗┻┗┗┗ ┛ ┗┫ ┛┗┗ ┗┻┗┗┛┗
┛ @sakibulalikhan
Usage: /usr/bin/abh [-t <charge_threshold>] [-r] [-v] [-h]
Options:
-t <charge_threshold> Set the charge threshold (default: 60)
-r Remove the charge threshold
-v Enable verbose mode
-h Display this help message
❓Options
-t <charge_threshold>
: Sets the charge threshold (default: 60%). This option allows users to specify a custom charge threshold.
-r
: Removes the charge threshold. Use this option to disable battery health charging.
-v
: Enables verbose mode. This option provides additional output for troubleshooting.
-h
: Displays the help message. Use this option to view usage instructions.
Installation
You can install the script easily by running the following commands:
wget https://raw.githubusercontent.com/sakibulalikhan/asus-battery-health/main/abh && sudo mv abh /usr/bin/ && sudo chmod +x /usr/bin/abh && abh
Manual Installation
Clone the repository:
git clone https://github.com/sakibulalikhan/asus-battery-health.git
Navigate to the cloned directory:
cd asus-battery-health-script
Give execution permission to the script:
sudo chmod +x abh
Run the script:
sh abh
Or
./abh
⚡ How to Use
Set the charge threshold to 60% (default)
abh -t # Sets the charge threshold to 60%
Set the charge threshold to a custom value (e.g., 80%)
abh -t 80 # Sets the charge threshold to 80%
Run the script in verbose mode
abh -t 80 -v # Sets the charge threshold to 80% and enables verbose mode
View help message
abh -h # Displays help information
Remove the charge threshold
abh -r # Removes the charge threshold
Contributing
Contributions are welcome! If you have any suggestions, improvements, or bug fixes, feel free to create an issue or submit a pull request.
License
This project is licensed under the MIT License.
Comments