Commands.page Logo

How to Enable Battery Status Meter in Htop Ubuntu

This article addresses the common request to display battery status within the htop system monitor on Ubuntu. It clarifies that the standard version of htop does not natively support a battery meter feature. Instead, this guide provides the most effective terminal commands and alternative tools to check battery percentage and health directly on your Linux system.

Htop Battery Support Limitations

The official htop tool available in the Ubuntu repositories does not include a battery status meter. Htop is designed specifically to monitor system processes, CPU load, memory usage, and swap space. There are no configuration flags, settings, or hidden options to enable battery monitoring within the standard htop interface.

Check Battery Status Using UPower

To view battery information in the terminal, use the UPower utility which is pre-installed on Ubuntu. Open your terminal and run the following command:

upower -i /org/freedesktop/UPower/devices/battery_BAT0

This output will display detailed information including the current percentage, state (charging or discharging), and time to empty or full.

Check Battery Status Using ACPI

For a simpler one-line output, you can use the ACPI tool. First, install it using the package manager:

sudo apt install acpi

Once installed, run the following command to see your battery status:

acpi -b

This will return the battery name, percentage, and current charging state immediately.

Use Powertop for Battery Monitoring

If you need a detailed power monitoring interface similar to htop, install Powertop. This tool is designed specifically for power consumption and battery stats. Install it with:

sudo apt install powertop

Run it using sudo powertop to see a comprehensive overview of battery usage, device power states, and estimates for remaining battery life.