A really tiny battery monitoring script to help out my dumb Linux battery monitor which only displays an alert when the battery's low. Of course, a visual notification requires you to be in front of the laptop in the first place. If you're not exactly in front of the laptop and it runs outta charge, it'll just silently shut itself off. And then there's the issue of overcharging: I'll plug it in and completely forget about the fact that it's been charging for, say, 4 hours. In this case, there's no notifications at all. So that's another problem.
So I wrote this small script that uses the Linux package espeak to yell at you when the battery goes below a certain limit, or if it's being charged, when the charge goes above a certain limit. This package is what's working under the hood for the Python speech synthesis library pyttsx3, so I guess the script should also work on Windows and Mac. It's been tested on Linux Mint 20.3 and Debian 11.