Archives For battery

Running Ubuntu laptop without power supply? It’s wise to keep an eye on the battery percentage. And, here’s how to make Ubuntu 22.04 display the info in top-right corner just besides the battery icon.

Method 1: Single command toggle display battery percentage

For those OK with Linux commands, just press Ctrl+Alt+T on keyboard to open terminal. When it opens, paste the command below:

gsettings set org.gnome.desktop.interface show-battery-percentage true

You’ll see the change immediately after hitting Enter to run the command.

And, to hide the percentage again, use command:

gsettings reset org.gnome.desktop.interface show-battery-percentage

Method 2: Use Gnome Control Center -> Power settings

In Ubuntu 22.04, the GNOME Tweaks tool no longer provide the option to toggle display battery percentage. Because, GNOME has merged this option into system settings (aka gnome-control-center).

1.) Firstly, open ‘Settings’ either from the dash or top-right system tray menu.

2.) When it opens, navigate to Power panel in the left. And, finally use the on/off switch in bottom right to toggle display battery percentage:

That’s it. Enjoy!

Want to check your laptop battery status in Ubuntu or other Linux? There’s a small indicator applet that can do the job in GNOME desktop.

Battery Status” is the free and open-source indicator applet developed by Lorenzo Carbonell, a software developer behind touchpad-indicator and my weather indicator.

It displays an icon on GNOME top bar in system tray area, along with the battery remaining time. By clicking on the applet, it shows battery percentage based on both current and original maximum capacities.

As well, it shows battery health via current and original maximum capacities, and the original and current Voltages.

Battery Health

A setting dialog is also available to configure the refresh time, warning, and colors, etc.

Battery Status Settings

How to Install ‘Battery Status’ in Ubuntu:

The app is available to install as GNOME Extension. At the moment, it supports for Gnome 3.36 and Gnome 40. Which means, user may install it in Ubuntu 20.04 and Ubuntu 21.10 via following steps.

1. Install ‘chrome-gnome-shell’:

Firstly, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to install the ‘chrome-gnome-shell’ package if you don’t have it:

sudo apt install chrome-gnome-shell

This package enables ability to install Gnome Extensions via a web browser.

2. Install the Extension:

Next, click the link button below to go to the extension web page and turn on the slider icon to install it:

If you don’t see the toggle icon, install the browser extension via the link in that page and refresh it.

NOTE: The pre-installed Firefox in Ubuntu 21.10 is a Snap package that does NOT support for installing Gnome Extensions so far. Use another browser or install Firefox as deb.

The indicator should appear immediately after installation. If not, try to enable it via “Gnome Extensions” app, which can be installed via command:

sudo apt install gnome-shell-extension-prefs

That’s all. Enjoy!

gnome shell

After moving to Ubuntu 17.10 Gnome Desktop, you may find that some handy indicator applet switches has gone.

One of them is that neither ‘Settings’ nor ‘Gnome Tweaks’ show options to enable battery percentage in top panel.

Also there’s no options to configure the date and time display settings in the center of the top panel.

1. To show battery percentage in Gnome panel, install dconf editor from Ubuntu Software.

2. Then launch it and navigate to org -> gnome -> desktop -> interface, scroll down and turn on the switch for ‘show-battery-percentage’.

There you can also set clock time format, show or hide date and seconds.

Battery Monitor

Battery Monitor is a simple tool written in Python3 and PyGTK3. It notifies battery status of charging, discharging, fully charged through desktop notifications. When the battery is below 10%, it plays a sound and pops up a notification bubble.

No command typing on terminal, no extra indicator, the tool just pop notifications when the battery status changes.

Battery charging battery discharging
battery is fully charged battery low

How to Install Battery Monitor in Ubuntu:

1. Use PPA.

Open terminal (Ctrl+Alt+T) and run the commands below one by one to install it from the PPA:

sudo add-apt-repository ppa:maateen/battery-monitor

sudo apt update

sudo apt install battery-monitor

So far, Ubuntu 16.04 and Ubuntu 14.04 are supported.

2. For those who don’t want to add PPA, grab the .deb installer from the release page.

Once installed, launch the tool via command battery-monitor for the first time. Or just restart, it will start in background automatically at login.

NOTE: The software is in very earlier stage, it may have bugs. Report issues and ask requests at https://github.com/maateen/battery-monitor/issues

To uninstall it, just run command:

sudo apt remove battery-monitor

And remove the PPA if added via Software & Updates -> Other Software tab.

Show battery percentage and time remaining

This quick tip is going to show you how to display your laptop’s battery percentage and time remaining to Ubuntu 14.04 panel. So that your system tray area battery icon will look like this:

Ubuntu 14.04 show battery percentage and time remaining

This can be done easily by doing a little changes through dconf Editor, install it via Software Center if you don’t find it in application menu or Unity dash.

1. Open dconf Editor. On the left side, navigate to com -> canonical -> indicator -> power.

2. Check the boxes that say “show-time” and “show-percentage” on the right.

dconf editor battery settings

That’s it. The changes take effect immediately.