How to check the status of using laptop battery running Linux

Previously, battery management on laptops running Linux was quite complicated. For years, Linux has been "famous" for managing inefficient battery life. Partly because a large amount of work is done on Linux to serve servers. Partly because it can't guess the user configuration setting. Are you running Plasma on Gentoo and compiling software from scratch? So say goodbye to battery life.

No matter how you set up your laptop, the best way to use your computer without interruption due to battery drain is to monitor it. The more you understand the laptop battery, the more you control it.

There are some great options to track the battery usage of the laptop. This article will show you how to check laptop battery status on Linux.

The default laptop battery monitor

Picture 1 of How to check the status of using laptop battery running Linux

Each desktop environment comes with its own battery tracking applet. When installing Linux on a laptop, these applets are usually configured and displayed by default.

Picture 2 of How to check the status of using laptop battery running Linux

On a darker desktop environment, the applet is probably just an update measure to show the current battery level. On powerful desktop environments like GNOME, you will also receive notification updates when the battery is charging and when it is running low.

These default trackers are your first 'defensive' row. Stay tuned and make sure you're not in the danger zone.

Use Battery Monitor tool

When you want more control over battery status notifications, there is an additional program you can install to get more detailed control of battery usage notifications. Battery Monitor is not available on any distribution, but is easy to install and use.

Install Battery Monitor

First, install the dependence

 sudo apt install build-essential python3 python3-gi libnotify-dev acpi 

Then download the latest version.

 Downloads wget cd https://github.com/maateen/battery-monitor/archive/master.zip 

Extract it and cd into the result folder.

 unzip master.zip cd battery-monitor-master 

Finally, install the application.

 sudo make install 

Setting

You now have access to both Battery Monitor and its settings via the desktop environment.

Picture 3 of How to check the status of using laptop battery running Linux

The Settings window does not have many things and is not very complicated. It only allows you to specify the battery level to receive notifications. All of the numbers here are calculated as a percentage, you can set as many notifications as you want.

Notification

Picture 4 of How to check the status of using laptop battery running Linux

As you can see, Battery Monitor sends notifications whenever you unplug the socket, in addition to the warning you have set.

Picture 5 of How to check the status of using laptop battery running Linux

Picture 6 of How to check the status of using laptop battery running Linux

It will also send notifications whenever your computer is charging and when fully charged.

GNOME Power Statistics tool

If you are running a GNOME desktop, you already have another good utility to monitor your energy usage and display it as a chart. The utility is GNOME Power Statistics. If you do not use GNOME, you can easily install it.

 sudo apt install gnome-power-manager 

Picture 7 of How to check the status of using laptop battery running Linux

When you open GNOME Power Statistics, you will see a list of devices on the left side of the window, select your battery. Initially, you will see a range of battery information, some useful, but most of this information you don't need right now.

Picture 8 of How to check the status of using laptop battery running Linux

Click on the " History " tab, for information on how the computer handles batteries. First, set the required time length. If you have just installed the energy manager, you need to work for 10 minutes so that it has enough time to gather data.

Check out the different charts, you will see things like charging and discharging rates. In addition, you also receive information about battery life and the time required for a full charge.

PowerTop tool

It is good to know which program is using the most battery on your system. Some processes can kill your battery without your knowledge, maybe it's something you don't use.

Picture 9 of How to check the status of using laptop battery running Linux

Most Linux users are familiar with Top, the utility that tracks applications that use the most system resources. There is a utility like Top that monitors battery usage called PowerTop. PowerTop may already be installed on your system, but you can install it easily.

 sudo apt install powertop 

Then, just run PowerTop to see which process is the worst 'offender'

 sudo powertop 

Like Top, it lists processes according to the amount of energy used. You can see if there is anything you can close or kill on the system. If you don't want to see the PowerTop name, you can export the output to an HTML file and open it in the browser to see the report is compiled in more detail.

 sudo powertop --html = report.html 

Hopefully with these tools, you can better understand battery usage on your laptop. Note, no tools are perfect, so using these tools together is the best. If you find that your computer is draining battery quickly, consider using a lighter desktop environment or setting other settings for the GPU. Like most mobile devices, monitors and graphics are the places that consume the most battery power on laptops.

See more:

  • No need to install any software, this is how to check your laptop battery level
  • Simple tips to help you save your laptop battery efficiently
  • 10 best battery saving apps today for Android
  • ncG1vNJzZmismaXArq3KnmWcp51ktbDDjK2mZpuYmrCsedOhnGarpJbBtr%2BMqJ1mraOeu6h5y5qnraegYq%2BiwNOeqbJloqq7r7XNoGSloZ6qxQ%3D%3D