Battery Applet with Monitoring and Shutdown (BAMS)

UUID: batterymonitor@pdcurtis
Last edited:
6 days ago 2018-12-07, 11:31 UTC
Last commit: [f9e9745c] batterymonitor@pdcurtis Update to version (#2139)

Displays Charge as Percentage and allows Alerts and Actions



Battery Applet with Monitoring and Shutdown (BAMS)


This is a simple applet I have written for my laptop because I have recently had a couple of times where I have missed the notifications about low battery and have had shutdowns losing data and potentially reducing battery capacity through a complete discharge. The applet draws on my code for the NUMA (Network Utilisation Monitoring and Alert) Applet so much of the code is well developed and tested.

This applet allows one to set a level at which the machine starts to shutdown (suspend to memory as currently set up) with plenty of warning - the shutdown level is 2/3 of the initial alert level which can be adjusted between 10% and 40%.


The current Settings and Power Applet only allow limited choices of handling low battery state - in fact latest version of Cinnamon seems to have lost the setting to specify the action when the battery is critical and there seems to be no easy way to set the 'critical shutdown' level in Mint 18 Sarah/Cinnamon 3.0 and higher. This applet complements the existing power facilities by allowing much more and easier control of automatic shutdown and recovery thereby considerably reducing the chances of both data lose or shortening battery life through accidental total discharge.


Fully supported by Author, under continuing development and in continuous use on several of his machines.


The applet normally shows the percentage charge on a coloured background which is:

  • Green when above the alert level (set currently to 1.5 times the 'shutdown' level.)
  • Green has Red Border when discharging.
  • Orange between the warning and shutdown level
  • Red and flashing at and below the Shutdown level (even when charging).

    When the battery is Discharging the warning and shutdown regions have a much longer flashing message in the applet which is difficult to miss.

  • When the Alert level is reached a modal alert is put up which can not be missed as no input can be made until it is cleared and short fixed audible alert is also given. For Cinnamon versions earlier than 2.6 an critical alert is used instead as modal alerts are not available. The default alert sound is short and high pitched.
  • NEW in version 1.3.4 The user's home folder is checked for a file called batterymonitorwarning.mp3 which is then used instead of the default. When a file is found a warning is given at startup that the volume and length should be restricted in public places. Mine lasts for 30 seconds and can be heard throughout the house so is not ideal for libraries - a copy can be found in the applet folder with thanks to Brandon at and used under Attribution 3.0 Licence.
  • When the Shutdown level is reached an alert box is put up with options of an immediate suspend or cancel - if nothing is done it suspends 30 seconds latter. If cancelled (or the machine is turned back on without the battery being on charge) the alert and shutdown sequence is restarted after the battery has dropped another 1%. The alert box is accompanied by an audible alert.

The alert level can be set to between 10% and 40% of full by a slider on the left click menu or in the configuration screen. The refresh rate can also be set in the configuration screen.

The intention is to allow the possibility of leaving suspend with enough battery to close programs and shut down after powering up from suspend without a charger after an accidental unattended suspend. It is suggested that the 'shutdown level' is set to about 10% to allow time. Do not forget that the battery still drains, although slowly, during suspend.

Version 1.3.0 introduced support for vertical panels and has extra display modes including an optional icon showing battery state. The modes, which are selected in the Configure screen, are:

  • Classic - Battery Percentage with an extended message in the panel as above (only for horizontal panels)
  • Classic Plus - Classic with addition of a Battery Icon (only for horizontal panels)
  • Compact - Battery Percentage without an extended message, just the background changes (suitable for vertical panels)
  • Compact Plus - Compact with addition of Battery Icon (suitable for vertical panels)
  • Battery Icon Only - retains the coloured background showing status (suitable for vertical panels)

If a Classic mode is used on a vertical panel the extended message is not shown which allows it to be used in a vertical panel in the default 'Classic' configuration.

The right click menu gives access to some useful utilities as well as the change log and this help file.

Many laptops do not implement a suspend well. The suspend which is in use is a Suspend to Memory which is better supported than Hibernate (suspend to disk) but it does use power a little power when in that mode so it is still possible to loose work if the level is set too low or it is left too long. It is sensible to make sure the laptop does suspend reliably before trusting this applet to save work. The code for suspending is different in Mint 18 and higher to Mint 17.3 and earlier versions. The script calls both methods which should not cause problems but you can comment out the redundant one if you want in suspendScript.

Translations and other Contributions

The internal changes required in the applet to allow translations are implemented and several translations are available. Translations are usually contributed by people fluent in the language and will be very much appreciated. Users please note I will rarely be able to take responsibility for the accuracy of translations!

Although comments and suggestions are always welcome any contributions which are contemplated must follow discussion. Changes can have many unintended consequences and the integrity of the applet is paramount. Unsolicited Pull Requests will never be authorised other than for urgent and critical bug fixes from the Cinnamon Team.


Cinnamon Version 2.2 or higher which is available for all the Mint versions which are still supported - currently back to Mint 17.0 LTS. Cinnamon 2.6 or higher is required to support Modal Alerts. The latest versions been tested up to Cinnamon 3.8 and no changes are expected for 4.0.

For full facilities including notifications and audible alerts the zenity sox and libsox-fmt-mp3 libraries must be installed. They can be installed wih the Synaptic Package Manager or using the following terminal command:

    sudo apt-get install zenity sox libsox-fmt-mp3

Manual Installation:

  • Download from the Spices Web Site
  • Unzip and extract folder batterymonitor@pdcurtis to ~/.local/share/cinnamon/applets/
  • Install the additional programs required.
  • Enable the applet in System Settings -> Applets
  • You can also access the Settings Screen from System Settings -> Applets or from the Applets Context menu



Log In To Comment!


The Clown
The Clown-1 year ago
Thanks, indicator works well, but my battery still will not charge (internal, HP Pavillion 15-AW053NR). I know it is not anything you can do, and I do appreciate your work and the awesome applet, so thanks again! The only thing that activates the charger is an overnight visit to the freezer for the laptop and power supply.
Peter Curtis
Peter Curtis-1 year ago
As the author I am committed to maintaining and developing this and all my other applets. I can be contacted here however posting a comment does not automatically cause me to be notified so if you want a rapid response please also alert me via . On github, @pdcurtis in any conversation should cause a copy to be emailed to me. Please take the time to 'like' applets you find useful even if you do not comment, it is a great motivator for the authors