Archives For November 30, 1999

This is a step by step beginner’s guide shows how to configure your Ubuntu laptop to limit the maximum battery charge level.

For those who keep laptop plugged in for long term, it’s better to set battery charge limit to reduce the battery wear by constantly trickle charging.

Linux Kernel supports battery charge threshold, and there’s a merge request to provide graphical UI options in Gnome Control Center. Until GNOME officially support this feature, you can follow this tutorial to do the job step by step.

Continue Reading…

Got wireless mouse, keyboard, or controller connect to your PC? You can have a glance at the battery level of them in top-bar of Ubuntu 22.04|22.10, Fedora 36/37, Arch/Manjaro with GNOME desktop!

This can be done via a Gnome Shell extension based on upower power management daemon.

Ubuntu 22.04 and Ubuntu 22.10 user can get the extension simply by following the steps below one by one.

1. First open Ubuntu Software, then search for and install the Extension Manager tool.

Install Extension Manager in Ubuntu 22.04+

2. Then, press Super (Windows Logo) key on keyboard to open Activities overview, search for and open the Extension Manager.

3. When the tool opens, navigate to ‘Browse’ tab. Finally, search for and install either extension below:

  • UPower Battery. – it just works but no configuration.
  • Battery Indicator (upower) – with option to toggle which device to display on panel and manually refresh.

The applet should be there in system tray area immediately after installation, though it can be empty if no wireless device detected.

For Fedora, Arch/Manjaro Linux with GNOME 42/43, just open the link Battery indicator or UPower Battery and use ON/OFF switch to install it. And install Gnome Extensions app from Gnome Software for configuring extensions.

Want to change system power mode between Performance, Balanced, and Power Saver automatically when plug / un-plug power supply?

Here’s an extension can do the job for Ubuntu 22.04, Ubuntu 23.10, Fedora 38/39, Debian 12, Arch and other Linux with GNOME from version 42 to 45.

GNOME introduced setting options to switch power mode since v40. For laptop running on AC power supply, user may use ‘Performance’ mode for gaming or doing heavy work. To prevent from draining power fast after un-plug AC power, it’s better to switch to ‘Balanced’ mode, or even ‘Power Saver’ mode when battery level is low. To automate this work, ‘Power Profile Switcher’ extension was born.

1. First, open Ubuntu Software app, then search for and install ‘Extension Manager’.

Install Extension Manager in Ubuntu 22.04+

2. Then, either click ‘Activities’ or 9 dots icon on dock, search for and launch ‘Extension Manager’. And, use it to search and install ‘Power Profile Switcher’ extension.

For Fedora Workstation and other Linux with GNOME 42/43, use ON/OFF switch in this page to install the extension.

3. After installed the extension, switch back ‘Installed’ tab in Extension Manager. Or, use Gnome Extensions tool to open the configuration dialog for it.

Finally, select your desired power mode when running on AC power and on battery. And, set the low battery level percentage to automatically go to power saving mode.

The system power mode will change automatically when you plug and un-plug power supply. That’s all. Enjoy!

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.