Monitoring Detailed Power Usage through the UI
There is no better tool available to monitor power usage on Linux than Gnome’s own Power Statistics tool. If you feel that any of your programs is using a significant amount of power or you are facing laptop battery issues, you can make use of this program. This utility is available in the Debian Stable Main repository and can be installed both through the Debian Software Manager(GUI) and the command line.
Installing Gnome Power Statistics Tool
If you want to use the Debian command line to install the tool, first open the Terminal through the Application Launcher search as follows:
In the Terminal, run the following two commands as sudo to install the Power Statistics tool:
$ sudo apt-get install gnome-power-manager
Alternatively, for installing this software through the UI, please open the Debian Software Manager through the Activities panel/Dock. Then search for Gnome Power Statistics and install the one developed by GNOME.
Viewing Power Statistics
Launch the Power Statistics tool through the Application Launcher search as follows:
As you open the tool, you will be able to view the AC adapter details as follows:
To view the laptop battery information, click on the Laptop battery option:
The other views on this tab such as History and Statistics also provide graphical information about battery usage, its health, and capability.
Monitoring Detailed Power Usage Report through the Command Line
Here are a few ways through which you can monitor power usage and view battery report through the Linux command line.
1. With the upower utility, you can monitor activity from the power daemon as follows:
2. The acpi utility displays battery status and thermal information by fetching it from the /proc and /sys files. Here is how you can install it on your system:
You have the following options to view power-related information, through acpi:
3. If you want to monitor the status of your battery, you can install the Batstat utility by running the following commands:
$ cd batstat/bin/
$ sudo cp batstat /usr/local/bin/
$ sudo chmod +x /usr/local/bin/batstat
Then, run the batstat command to continuously monitor the battery status report:
Using Less Power on a Linux system
Here are a few tips through which you can ensure optimized power usage on your Linux system.
Method 1: Limiting Screen Brightness
A high brightness level takes quite a good tool on your power usage, be it AC or battery. If you adjust the brightness level for your screen to the lowest possible value, you will see a remarkable difference in the power used by your system. On Debian and Ubuntu, you will see Screen Brightness as the first adjustable setting you can make under Power Saving in your system settings.
Other things that will help are dimming the screen when inactive, switching off WiFi and Bluetooth if possible, and switching to a blank screen on x minutes of inactivity.
Method 2: Limiting USB devices
USB devices do not come with a power source of their own. The more the number of USB devices attached to your system, the more they leech on your system’s power source. Keep your USB devices to a minimum if you want to optimize your power usage/battery life.
Methos 3: Enabling TLP
TLP is an open-source and feature-rich facility that is used for power optimization on Linux systems. You can use its CLI or the GUI depending on your ease of use. When you enable TLP on your system, it optimizes power usage, all according to your operating system and the underlying machine. Here is how you can install it through the command line:
Once done, you can start TLP through the following command
In order to view system and power statistics through TLP, run the following command:
Method 4: Disabling Screensavers
Screensavers and screensaver software cost a lot of power on your system, especially if you are running the ones with heavy graphics. We suggest getting rid of any such extra software and also disabling the default screensaver application by running the following command:
This will, however, set the screensaver off for the current login session. To disable the screensaver for good, open the .xsession file through the following command:
Then, add the following line and save the file:
Restart your system for the change to take effect.
Method 5: Using Lightweight Software
With the powertop utility, you can gauge which software is causing a burden on your power usage. You can install the utility through the following command:
Once you know about the heavy elephants on your system, you can get rid of them if they are causing more burden than ease.
This was all you needed to know about monitoring and managing power on your Linux system. This will be especially useful if you are running your system on a battery instead of AC.