Battery-alert

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 https://github.com/mandeeps708/battery-alert

Advertisements

2 thoughts on “Battery-alert

  1. Pingback: 19 September | Mandeep Singh
  2. Pingback: 18 September | Mandeep Singh

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s