TLPUI – Increase your laptop battery life on Linux

If you have ever used Linux which is installed on a Laptop, then you must have noticed the heavy battery usage during your work. This is perhaps one of the major disadvantages of Linux and discourages many people from using Linux. Since battery life reduces gradually throughout the recharge cycles, your battery will also degrade quickly if this problem is not corrected. There is no permanent solution to this, but there are many tools that configure your OS settings so that it uses less power.

TLPUI is a frontend to the TLP command-line utility, which is among the many tools such as powertop and is used for improving battery life. Out of the box, TLP uses powertop recommended settings, so you don’t have to manually enable powertop settings at every startup using systems.

Struggling with battery life? Always on Bluetooth could be a reason. Learn how to disable Bluetooth on Ubuntu startup.

In this tutorial, we will install TLPUI and apply the settings to improve our battery life.

Install TLP

Before we run the GUI frontend TLPUI, let’s install TLP first. Depending upon your Linux distribution, open a terminal and type the following commands :

On Debian and Ubuntu-based distribution :

Add the official TLP PPA to your repositories by typing the following command :

sudo add-apt-repository ppa:linrunner/tlp

Now, update your repositories and install the package using :

sudo apt update
sudo apt install tlp tlp-rdw

We will also need the git command in the future, install it via :

sudo apt install git

On Fedora Workstation

Simply type the following commands in your Terminal

sudo dnf install tlp git

On Arch Linux and Arch-based distributions

The package is available in the official repositories, therefore you can install it using the Pacman package manager.

sudo pacman -S tlp git

Installing TLPUI

Now that you have git installed, clone the repository by typing the following commands, regardless of the distribution you are using:

git clone https://github.com/d4nj1/TLPUI

After the download is finished, you can enter into the cloned directory by typing the following command:

cd TLPUI
Clone The TLPUI Repository Using Git
Clone The TLPUI Repository Using Git

Now, to run the program, just execute the python file by typing the following command:

pythin3 -m tlpui
Launch TLPUI
Launch TLPUI

Note that Arch Linux and its based distributions (Manjaro, Artix, Endeavour) users can directly install this tool from the AUR with your favorite AUR helper:

# For yay users
yay -S tlpui-git

# For Paru users
paru -S tlpui-git
TLPUI Interface
TLPUI Interface

Now, you can see that a GUI application will open up, first open the statistics tab and click on the simple button to fetch recommended settings.

Recommendations If Any Will Be Mentioned At The Bottom
Recommendations (if any) Will Be Mentioned At The Bottom

Now, navigate to the configuration tab again and apply all the recommended settings and your custom settings so that you can save some power usage. There are many power profiles available for your GPU and CPU, so you could definitely save some power by shaving off some power consumption.

I will also recommend you disable the ‘USB auto suspend’ feature mentioned in the ‘USB’ field, otherwise, it will remove the USB when not in use (hassle for USB keyboard/Mouse users).

Disable USB Auto Suspend Feature
Disable USB Auto Suspend Feature

Nowadays, many systems ship with a power profiles daemon to save power, but that package conflict with TLP, and therefore you need to disable it at startup so TLP could work. Simply type the following commands in the Terminal :

sudo systemctl mask systemd-rfkill.service
sudo systemctl mask systemd-rfkill.socket

Now, enable TLP to run at startup :

sudo systemctl enable tlp.service

Summary

TLP is still a ‘hacky way’ to squeeze out more performance using the same battery. For comparison, my battery used to last 6 hrs on Windows, but on Linux, it has massively dropped to 4 hours. That is still usable, but of course I’m losing 2 hours of battery life. The manufacturer of your laptop is at blame here, since it is very hard to build a driver out of scratch that supports every device and the manufacturer could open source their driver if they want to, but they don’t.

References

TLPGUI – GitHub Page