From a past few days, this happened many times with me that the system warns me to plug-in the charger else it’ll shut down soon. But who cares? 😛 Okay, sometimes I don’t. And that resulted into direct shutdown. So I thought of making a script of alerting me with a sound (and may be a dialog) when the battery level reaches a certain level (>80% and <20%).
After starting with it, the first thing I needed to know was the current battery level of the system through the command line. So, one of achieving it is by using the upower command. Then I used made comparisons with battery level. For playing sound, I used play command that can be used after installing sox (apt-get install sox).

Link to github repository is


2 thoughts on “Battery-alert

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close