+5 votes
268 views
How to check battery usage in Linux

in Linux / Unix by (552k points)
reopened | 268 views

1 Answer

+3 votes
Best answer

1. How to use battery Monitor in Ubuntu to buy battery usage
2. How to use battery Monitor in Ubuntu to buy battery usage from PPA repositories
3. How to view GNOME power statistics on Linux
4. How to check battery usage on Linux with PowerTop

When we manage or use Linux laptops, regardless of their distribution , there are a number of sensitive issues on which we must pay attention to have the best performance and one of these elements is undoubtedly the battery. As we use the equipment and its multiple programs and applications , the battery life cycles are gradually consumed and if we reach the limit of this we will have problems since it will be necessary to connect the equipment directly to the current for use which restricts its portability..

There are several useful tools that allow us to manage and control battery usage in Linux environments. By default, Linux desktop environments allow us to perform certain actions on the battery by clicking on the icon at the top or bottom:

image

We can see the current percentage of battery usage:

image

Let's see some of the practical utilities for this administration.


1. How to use battery Monitor in Ubuntu to buy battery usage


It is a program that has been designed basically to display notifications about charging, downloading and not charging the battery status in Linux environments. Battery Monitor is a utility tool that has been developed in Python3 and PyGtk3.
Step 1

For this case we will use Ubuntu and for its installation we will execute the following command to install the necessary dependencies:
 sudo apt install build-essential python3 python3-gi libnotify-dev acpi 
After this, we will run the following line to download the latest version:
 cd Downloads wget https://github.com/maateen/battery-monitor/archive/master.zip 

image

Step 2

We proceed to decompress the file and access the directory created:
 unzip master.zip cd battery-monitor-master 

image

Step 3

After this we proceed with the installation of the utility:
 sudo make install 

image


2. How to use battery Monitor in Ubuntu to buy battery usage from PPA repositories

Step 1

This utility can also be installed from the PPA repositories by executing the following:
 sudo add-apt-repository ppa: maateen / battery-monitor -y sudo apt-get update sudo apt-get install battery-monitor -y 
We can access the utility from the search engine:

image

Step 2

This application will automatically run in the background and when accessing pro first time we will see the following. image
Step 3

There we can configure the percentages of the battery notifications according to their status.
Depending on this we will receive the respective notifications either full load, download or upload:

image


3. How to view GNOME power statistics on Linux


It is a utility integrated in the GNOME environment through which we can carry out the tasks of control and supervision of energy and other components.
Step 1

This is installed by default, but if not, we can install it by running the following:
 sudo apt install gnome-power-manager 
We will access it from the search engine:

image

Step 2

At the time of access we go to the Laptop battery section where we will see a complete summary of the current battery status: image
Step 3

In the History or History tab, we can access statistics based on times (10 minutes, 2 days, 6 days, one week): image

4. How to check battery usage on Linux with PowerTop


This utility is linked to the Top command in Linux and is ideal to know in detail what applications or services are making high energy consumption in the system.
Step 1

For its installation we will execute the following:
 sudo apt install powertop 

image

Step 2

To know which services use energy, we execute the following. There we find this information in detail.
 sudo powertop 

image

Step 3

We also have the possibility of exporting this result to HTML format for later opening in any browser, for this, just run the following line:
 sudo powertop --html = report.html 

image

Step 4

Then we will double click on the file created and this will be the result displayed: image

We can see a general summary or go to each section for detailed information..

With these options we will have better control over the battery in Linux.


by (3.5m points)
edited

Related questions

+3 votes
1 answer
+5 votes
1 answer
asked Oct 4, 2019 in Linux / Unix by backtothefuture (552k points) | 351 views
+4 votes
1 answer
asked Oct 14, 2019 in Linux / Unix by backtothefuture (552k points) | 262 views
+4 votes
1 answer
asked Nov 22, 2022 in Guides by backtothefuture (552k points) | 65 views
+3 votes
1 answer
asked Nov 7, 2019 in Linux / Unix by backtothefuture (552k points) | 272 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users