DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Battery level alert
1001pepi
1001pepi

Posted on

Battery level alert

Hi dear developers.

Here I want to share with you a small script that will help us make better use of our main working tool: *our lovely computers :).

As you know, nowadays, most computer batteries are lithium-ion ones. So they have a maximal cycle of discharging-recharging. When this number of cycles is reached, the battery is no longer able to efficiently store energy for a long time, and thus his autonomy goes down to a critical level.

To avoid this we can try to maintain the level of charge of the battery in a given interval ([20%, 80%] for example), avoiding complete discharge and also letting the battery in charge for too long, which is also not good for his lifetime.
Sometimes we are so engrossed by our work that we don't notice when the battery level is too low or when it is already full.

So I wrote a small customizable script that will vocally alert us of the level of the battery, asking us to plug or unplug it. The script is working on Debian based OS such as Ubuntu.

You can find the source code of the program here on my GitHub with all the instructions on how to run it and customize it as you want.

I hope it will be useful for you, and I am also waiting for your feedback.

Thanks for reading...

1001pepi

Top comments (0)

πŸ” If you came here from Google, why not take a look at some of our top posts?