TLPUI Is A Graphical User Interface For TLP Power Management Tool (Ubuntu Installation Instructions)

TLP is an advanced power management tool for optimizing battery life on laptops running Linux. Its default configuration is usually enough to see an improvement in battery life, however, TLP offers a wide range of configuration options which can be changed by editing its configuration file.

TLP GUI

TLP is a command line tool and it doesn't come with a graphical user interface, but there is a third-party GTK GUI (written in Python) interface for TLP, called TLPUI.

TLPUI is considered to be beta software. In this development stage, it can read, display and save the TLP configuration, show information about configuration changes (the default values and saved/unsaved state), as well as display tlp-stat statistics.

TLPUI showing an option was changed (and needs to be saved to be applied) and its default value

The tool project page mentions that TLPUI still needs some translation optimizations. There are also no binaries right now so to use TLPUI you'll need to install it from source.

How to install TLPUI in Ubuntu, Debian or Linux Mint


Here's what you must do to install TLPUI in Ubuntu, Debian or Linux Mint (and Debian/Ubuntu-based Linux distributions like elementary OS, etc.).

1. Install TLP

TLPUI doesn't work without TLP so the first thing you need to do is install TLP. The tool is available in the Ubuntu repositories starting with Ubuntu 16.04 / Linux Mint 18 and in all supported Debian releases. You can install it using this command:

sudo apt install tlp tlp-rdw
sudo tlp start

There's also a TLP PPA you can use to get the latest TLP version on older Ubuntu / Linux Mint releases. You can find PPA installation instructions (and instructions on installing TLP in other Linux distributions) on this page.

2. Install packages required to download and build a TLPUI DEB package

TLPUI depends on PyGObject. To get the latest code from Git we'll need to install git. And to build the package, python3-setuptools and python3-stdeb need to be installed (along with some other packages that are automatically installed as dependencies of these two).

To install these packages in Debian, Ubuntu or Linux Mint, use:

sudo apt install python3-gi git python3-setuptools python3-stdeb

3. Get TLPUI from GitHub, build a DEB package and install it:

git clone https://github.com/d4nj1/TLPUI
cd TLPUI
python3 setup.py --command-packages=stdeb.command bdist_deb
sudo dpkg -i deb_dist/python3-tlpui_*all.deb

The dpkg command installs the generated TLPUI DEB package (python3-tlpui_0.1-1_all.deb), but you can also install it using a graphical tool. You'll find the generated TLPUI DEB package in the TLPUI/deb_dist folder.

4. Missing TLPUI user configuration workaround

In my case, the TLPUI configuration file was empty at first (it contained only a [default] entry after trying to run tlpui), which causes the tool not to run without administrator privileges. To work around this issue, open the ~/.config/tlpui/tlpui.cfg file with a text editor (create this file if it doesn't exist) - for example you could use these commands to open it with Gedit text editor:

mkdir ~/.config/tlpui
gedit ~/.config/tlpui/tlpui.cfg

And replace the contents of this file with the following (you can adjust these options):

[default]
language = en_EN
tlpconfigfile = /etc/default/tlp
activecategorie = 0
windowxsize = 900
windowysize = 600

Remember to save the file when you're done. TLPUI fails to start if it's run without sudo and any of these options is missing from its user configuration file.

There is no menu entry for TLPUI so to start it you'll need to either press ALT + F2 or open a terminal and type:

tlpui

After making any changes to your TLP configuration using TLPUI, remember to select File > Save in TLPUI to actually save any changes you may have made to the TLP configuration.

1 comment:

  1. As usual, excellent instructions.

    I've always wanted a UI for TLP. Thanks.

    ReplyDelete

Powered by Blogger.