Optimize Battery Health: How to Set Charge Thresholds for ASUS Laptops on Linux Made Easy

Optimize Battery Health: How to Set Charge Thresholds for ASUS Laptops on Linux Made Easy

Asus Battery Health Charging Script For Linux

Author: @sakibulalikhan

image

Asus laptops come with a built-in feature known as Asus Battery Health Charging, which is often integrated into the MyAsus application. This feature enables users to set a charging threshold, typically at 60%, when the laptop is connected to AC power. Maintaining the battery charge at 60% helps mitigate heating issues, enhances performance, and significantly extends the overall lifespan of the laptop battery.

However, this feature is exclusively available for Windows operating systems, leaving Linux users, including those on Ubuntu, Linux Mint, Elementary OS, Pop OS, Fedora, Arch, and others, without official support. This void can deter users from transitioning to Linux for its performance benefits or other preferences.

Despite the absence of official support from Asus for Linux-based operating systems, this script provides a practical solution. It enables users to implement battery charging thresholds in Linux environments, ensuring the benefits of battery health charging are accessible across different platforms.

The script has undergone thorough testing 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, execute 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 purposes.
  • -h: Displays the help message. Use this option to view the script’s usage instructions.

Installation

wget clone https://raw.githubusercontent.com/sakibulalikhan/asus-battery-health/main/abh && sudo mv abh /usr/bin/ && sudo chmod +x /usr/bin/abh && abh

Manual Installation

  1. Clone this repository
git clone https://github.com/sakibulalikhan/asus-battery-health.git
  1. Navigate to the cloned directory
cd asus-battery-health-script
  1. Give execution permission
sudo chmod +x abh
  1. Run script
sh abh

Or

./abh

How to Use:

  1. Execute the script with default options
abh -t # Sets charge threshold default to 60%
  1. Execute the script with your preferred options
abh -t 80  # Sets charge threshold to 80%
  1. Execute the script with Verbose mode
abh -t -v
  1. Help command
abh -h
  1. Remove charge threshold
abh -r

Contributing:

Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please create an issue or submit a pull request.

License:

This project is licensed under the MIT License.

Follow me on Twitter @sakibulalikhan

Support Me:

Buy Me A Coffee

Comments