Skip to content

Simple program that sends a notification when the laptop battery is low!

License

Notifications You must be signed in to change notification settings

koralowiec/battery-notifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battery notifier

Just a simple program, which checks every x minutes if a battery is below the specified threshold. If the battery is low (and not being charged) it sends a notification.

Why? I use a i3{,-gaps} for a while, but I haven't set up any "low battery reminder", so I decided to try to create one.

On the screenshot below you may see an example notification popped out by dunst :

Yeah, I know 94% is not low, but... I've set the threshold to 100% so I could capture a notification as my battery was almost full :D


Using these packages:

Install

go get gitlab.com/koralowiec/battery-notifier

or:

git clone https://gitlab.com/koralowiec/battery-notifier.git
cd battery-notifier
go build main.go
mv main battery-notifier

Running via cron

crontab -e

To run every minute add something like the line below (remember to adjust path to the binary, optionally you may want to change the threshold via -t):

*/1 * * * * /home/arek/horsing-around/battery-notifier/battery-notifier -t 40

About

Simple program that sends a notification when the laptop battery is low!

Resources

License

Stars

Watchers

Forks

Languages