Many a times we forget to remove the laptop charger. This can reduce the battery life significantly due to overcharging. This is where Battery Monitor comes into play.
Battery Monitor is a utility tool developed on Python3 and PyGtk3. It will notify the user about charging, discharging, not charging and critically low state of the battery on Linux (surely if the battery is present). Along with showing the notification repetitively, It also plays a sound so that you don't miss the notification.
- Download Latest Version
- Features and Screenshots
- Dependencies
- Installation
- User Manual
- Issue Tracking and Contributing
- Contributors
Add the Launchpad PPA
sudo add-apt-repository ppa:mamolinux/gui-apps
sudo apt update
sudo apt install battery-monitor
Get the debian package archive from GitHub. For installation, check here.
Download Source (.zip)
Download Source (.tar.gz)
Download Binary (.deb)
Battery Monitor notifies the user:
- Whether battery is present,
- When charger is plugged in,
- When charger is unplugged,
- When battery is full and charger is not unplugged,
- When battery is critically low.
Additionally, it can show notifications:
- At three user-defined battery percentage during discharging,
- At one user-defined battery percentage during charging,
- Along with playing a sound (Mute option is not available yet).
In Settings menu, you can configure and adjust settings for Battery Monitor. Here, you can set the battery percentage levels at which you want to get notifications. The warning levels are listed in ascending order. Critical Battery Warning refers to the lowest level while First Custom Warning refers to the highest level. Custom warning levels are optional.
N.B. If you change any configuration, it will be in action only after next reboot.
The following dependencies are required to build Battery Monitor.
gettext
desktop-file-utils
libglib2.0-bin
libgtk-4-bin
meson
python3
python3-sphinx
python3-sphinx-argparse
The following dependencies are required to run Battery Monitor.
acpi
gir1.2-appindicator3-0.1
gir1.2-gtk-3.0
gir1.2-notify-0.7
python3
python3-configobj
python3-gi
python3-setproctitle
python3-tldextract
To install runtime dependencies on Debian/Ubuntu based systems, run:
sudo apt install acpi gir1.2-appindicator3-0.1 gir1.2-gtk-3.0 \
gir1.2-notify-0.7 python3 python3-configobj python3-gi \
python3-setproctitle python3-tldextract
Note: If you are using gdebi
to install Battery Monitor from a .deb
file, it will automatically install the dependencies and you can skip this step.
Remove apt install
in the command given in Debian/Ubuntu based distros and use the command for the package manager of the target system(eg. yum install
, dnf install
, pacman -S
etc.)
Note: There might be cases where one or more dependencies might not be available for your system. But that is highly unlikely. In such situations, please create an issue.
There are two ways, this app can be installed on a Debian/Ubuntu based system.
Download the latest binary .deb files from here. Then install the GUI Frontend from terminal as
sudo dpkg -i battery-monitor*.deb
sudo apt install -f
If you are having trouble installing the pre-built binary, build them from source.
There are two methods, this app can be installed/used on a Debian/Ubuntu based system. First, download and unzip the source package using:
wget https://github.com/mamolinux/battery-monitor/archive/refs/heads/master.zip
unzip master.zip
cd battery-monitor-master
-
Option 1: Manually copying necessary files. For that, follow the steps below:
- Install python package sources using
meson
:It will install all files underrm -rf builddir meson setup -Dprefix=$HOME/.local builddir meson compile -C builddir --verbose meson install -C builddir
/home/<yourusername>/.local
. To remove the locally (/home/<yourusername>/.local
) installed files, run:ninja uninstall -C builddir
- To manually install for all users:
The last step requires Administrative Privilege. So, be careful before using this. To remove the installed files, run:
rm -rf builddir meson setup builddir meson compile -C builddir --verbose sudo meson install -C builddir
sudo ninja uninstall -C builddir
- Install python package sources using
-
Option 2: Build a debian package and install it. To build a debian package on your own:
-
After using
cd battery-monitor-master
, run:dpkg-buildpackage --no-sign
This will create a
battery-monitor_*.deb
package at../battery-monitor-master
. -
Install the debian package using
sudo dpkg -i ../battery-monitor_*.deb sudo apt install -f
-
After it is installed, run battery-monitor
from terminal or use the battery-monitor.desktop
.
- Install the dependencies.
- From instructions for Debian/Ubuntu based systems, follow Option 1.
Every time Battery Monitor starts automatically after PC boots up. It pops up notifications and you see its Icon in the system tray. To reveal the other beauties, you can click on the icon. Currently, there are three menus: Settings, About and Quit.
You can also start battery monitor from the menu entries. Please, search for Battery Monitor launcher in the menu entries and simply click on it. In case, if Battery Monitor doesn't start automatically, please open an issue. We would like to debug the issue and help you.
If you are interested to contribute and enrich the code, you are most welcome. You can do it by:
- If you find a bug, to open a new issue with details: Click Here
- If you know how to fix a bug or want to add new feature/documentation to the existing package, please create a Pull Request.
NB: Using the issue template or PR template is not mandatory.
I am managing these apps all by myself during my free time. There are times when I can't contribute for months. So a little help is always welcome. If you want to test Battery Monitor,
- Get the source package and unzip it using:
wget https://github.com/mamolinux/battery-monitor/archive/refs/heads/master.zip unzip master.zip cd battery-monitor-master
- Make desired modifications.
- Manually install using option 2.
- Test it by running in debug mode from terminal:
battery-monitor --verbose
All translations are done using using Launchpad Translations. To help translate Battery Monitor in your favourite language follow these steps:
- Go to translations page on Launchpad.
- Click on the language, you want to translate.
- Translate strings.
- Finally, click on Save & Continue.
Current maintainer.
He is the original creator of now archived Battery Monitor. We are highly grateful to him for offering this useful app and providing the base for the current Battery Monitor. Please take a minute to thank him.
He has reformatted the code in a new style. The style represents the code easier to understand. Also, he has optimized the code in a way that Battery Monitor consumes a little resource of your PC. Please take a minute to thank him.
He has fixed some bugs and optimized Battery Monitor in a way so that it consumes lower CPU and RAM than before. Please take a minute to thank him.
He is our official package maintainer in AUR. He has put Arch users' life at ease. Please take a minute to thank him.
He has improved the build process and added modern Python setuptools packaging. Please take a minute to thank him.
I am a freelance programmer. So, If you like this app and would like to offer me a coffee ( ☕ ) to motivate me further, you can do so via: