Create a systemd service to set the battery charge stop threshold on boot.īefore creating the systemd service, check if your laptop actually has charge_control_end_threshold in /sys/class/power_supply/BAT* (without it, this won't work): In this example (from my ASUS notebook), the name of the battery is BAT0, but like I mentioned above, for you it may also be BAT1 or BATT, these being the only supported battery names by the kernel for ASUS laptops.Ģ. This command should output something like this: This can be done by using the following command: Let's start by figuring out the battery name for your ASUS laptop.
LUBUNTU MACBOOK BATTERY LIFE HOW TO
How to set a battery charge stop threshold for ASUS laptops on Linuxġ. You might also like: auto-cpufreq Is A CPU Speed And Power Optimizer For Linux As a side note, here's a GUI for TLP to easily configure it, in case you're not using it already. Lenovo has had support for this for quite a while, and TLP has support for setting this built-in (only for IBM/Lenovo ThinkPads). But since I only own an ASUS laptop and I can't test it on other devices, this guide is for ASUS only. After a while (so this is not instant when you connect your laptop to AC), the battery indicator changes to say "Not charging", as it should.īesides ASUS, some Lenovo and Huawei (with the latter getting support with Linux 5.5) laptops also have support for limiting battery charging. This happens even though the battery is not charging. With my ASUS ZenBook 14 UX433FAC running Ubuntu 20.04 with GNOME Shell, when limiting battery charging while the battery level is equal or greater than the charge threshold, and then connect the laptop to AC, the battery indicator from the top panel changes from the time remaining until the battery discharges to the time remaining until the battery is charged. Also, with AC connected, if the battery level is higher than the charge stop threshold, it will not be discharged to the stop threshold.Īnd another note. It's important to mention that the kernel WMI method of setting the battery charge threshold for ASUS notebooks can only set the stop value ( charge_control_end_threshold) (it can't also set the start threshold). For ASUS laptops using BATC battery name, you'll need to use Linux 5.9 or newer.Īlso, not all ASUS laptops support setting a battery charge threshold so depending on your ASUS laptop model, this may or may not work for you there's no list of supported devices that I could find. For ASUS laptops using BATT as the primary battery name, you'll need kernel 5.7, while for BAT1 you'll need the 5.8 kernel(in the instructions below you'll see exactly how to check the battery name). So while ASUS laptops support limiting battery charging starting with Linux 5.4, that's only for laptops having BAT0. However, for some newer ASUS laptops, the primary battery is not called BAT0, but BATT (e.g. The kernel WMI method to set the charge threshold does not provide a way to specify a battery, assuming it's the first battery ( BAT0).
LUBUNTU MACBOOK BATTERY LIFE FULL
A battery charge threshold reduces the amount of time at full charge (100%), and thus improves battery health / life.ĪSUS laptops support setting a charge threshold starting with Linux 5.4. This article explains how to set a battery charge threshold for ASUS laptops on Linux.īattery lifespan is affected by age, high temperatures, the number of charge cycles, and the amount of time at full charge. Newer ASUS laptops support limiting the battery charge level, which helps prolong battery life.