Your laptop and smartphone’s “battery” is what has given it the status of being portable. This is how much important a battery, its capacity, and its heath is. A battery, when new, is able to run for longer hours but as years pass by, your battery starts providing lesser juice. Therefore, time and again, we should keep checking out laptop’s battery report to know when is it time to get a new one.
In this article, we will explain how to view your Laptop’s battery report through:
- The Debian graphical user interface
- The Debian command line
We have run the commands and procedures mentioned in this article on a Debian 10 Buster system.
View Battery Report from the GUI
The Gnome Power Statistics tool can show historical and current battery information and programs waking up that used power. You probably only need to install this application if you are having problems with your laptop battery, or are trying to work out what programs are using significant amounts of power.
You can use the following command in your Debian command line, the Terminal, in order to install this tool.
$ sudo apt-get install gnome-power-manager
Note: You can open the Terminal application easily through the Application application launcher search bar.
Alternatively, you can use the Debian Software Manager to install this utility. You can open the Software Manager from the system Dock/Activities Panel as follows:
Search for Gnome Power Statistics and the first search entry that you see below is the one you need to install:
You can launch this application by entering either “battery” or “power statistics” keywords in your Application launcher search. You can access this search bar by hitting the Super(Windows) key from your laptop.
The Power Statistics tool opens in the AC adapter view by default. Open the laptop battery view and you will be able to see Details about your battery as follows:
The History and Statistics view also give you detailed information about the battery used through the various graphs. This helps you in predicting the health of your battery and it’s potential capability.
View Battery Report from the Command Line
The Debian command line also provides many ways for you to view and monitor your laptops battery’s performance. Please choose one of the following ways, based on your preference, in order to analyze your battery.
Method 1: Through the upower utility
Luckily, the Upower utility comes installed by default in most Linux distros. Enter the following command in your Terminal application to get a detailed battery report:
$ upower -i `upower -e | grep 'BAT'`
In order to view only the battery charging status, you can use the command in the following manner:
$ upower -i $(upower -e | grep BAT) | grep --color=never -E "state|to\ full|to\ empty|percentage"
You can use the following command syntax in order to print the report to a file:
$ upower -i `upower -e | grep 'BAT'` > filename.txt
Method 2: Through the Batstat utility
The batstat command lets you view the battery level, energy, full charge energy, battery level history and much more. Use the following steps in order to install the utility from Git:
1. Run the following command in your Terminal in order to get the Batstat clone from the github website:
$ git clone https://github.com/Juve45/batstat.git
2. Move to the bastat’s bin folder through the following command:
$ cd batstat/bin/
3. Then run the following command in order to copy batstat to the current user’s bin folder.
$ sudo cp batstat /usr/local/bin/
4. Make the copied binary file executable by running the following command:
$ sudo chmod +x /usr/local/bin/batstat
You are now ready to use the batstat command.
This is the way you can monitor your battery use through batstat:
If you get the following output, you need to install the libncurses package on your Debian:
Run the following command in order to install this package:
$ sudo apt-get install libncurses5
$ sudo apt-get install lib32ncurses5 for 32 bit systems.
Method 3: Through the acpi command
The acpi command displays information from the /proc or the /sys filesystem, such as battery status, thermal information, and more ACPI related information.
Run the following command in your Terminal in order to install the acpi utility:
$ sudo apt-get install acpi
Once the command is installed, run the command with the -V flag in order to view the complete battery report:
$ acpi -V
You can run the following command in order to print this report to a text file:
$ acpi -V > filename.txt
These were the very simple 4 ways through which you can get detailed battery report for your Debian laptop. You can make a choice based on your command line or UI preference, and also the format in which the information is displayed.