How To Limit Battery Charging (Set A Charge Threshold) For ASUS Laptops On Linux

Sakibul Ali Khan
4 min readApr 16, 2022
How To Limit Battery Charging (Set A Charge Threshold) For ASUS Laptops On Linux

Nowadays Asus laptops have a preinstalled program called Asus Battery Health Charging. In recent laptops, this feature is integrated into the MyAsus application. Using this feature users can set the charging threshold to 60% when they use it on AC power. A laptop will maintain a 60% charge when connected to AC power. This feature reduces laptop heating and improves performance. But, most important of all, it extends the life of the laptop battery.

Although it’s a great feature to have, it is limited to Windows OS only. So, users who want to shift to Linux OS (like Ubuntu, Linux Mint, Elementary OS, Pop OS, etc.) for better performance or due to other reasons will face a great disappointment. In a way, it will discourage users to use Linux on their Asus Laptops.

Even though there is no official support by Asus for Linux Operating Systems, there is an easy way to enable Asus Battery Health Charging or in common language battery charging threshold in Linux operating systems. In this post, I will be discussing the whole process to enable the same.

However, as a side note, this method will work on most the Linux-based OS’s and has been tested on the latest versions of Ubuntu and other Ubuntu-based OS (Kubuntu, Lubuntu, Xubuntu, etc.), Linux Mint, PopOS, Elementary OS, and Zorin OS.

So, Let’s begin our journey

Firstly make sure that your system is up to date. If not sure, then try running this command in the terminal:

sudo apt-get update && upgrade -y

Let’s start by figuring out the battery name for your ASUS laptop. This can be done by using the following command:

ls /sys/class/power_supply

We can change the value by simply running the following command in the terminal:

For laptops with BAT0:

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

This method works but, it is not a permanent solution as it will revert back to its default value i.e. 100 after reboot. So, you have to run this command every time the laptop restarts.

So we move to the next step to make it permanent.

Now try to make permanent

So, to make it permanent we have to run this command at every startup. To achieve that we have to add this command to the /etc/crontab file. (In Linux, using crontab we can run different activities at different instances. In this case, we shall run the command at reboot.)

To edit the ‘crontab’ file run the following command in the terminal:

sudo nano /etc/crontab

Now add the following lines at the end of the crontab file:

For BAT0:

@reboot root echo 60 > /sys/class/power_supply/BAT0/charge_control_end_threshold

(In my case, I did it before. so, I don’t open it with sudo. For this reason, it shows unwriteable. But if you open it with sudo it will writeable.)

Now press “ctrl + x”, then “y” Then “enter”

IT makes that file save. Is it saved or not let’s check it:

cat /etc/crontab

Now, every time you’ll reboot the laptop, Asus Battery Health Charging will be enabled by default. Now you can work on your Linux system without worries.

Just click and support

--

--

Sakibul Ali Khan

Currently I’m a student and I love computers. I love programming and playing with technology. I am highly interested in cyber security.