dotfiles

My opinionated dotfiles
git clone git://git.erethon.com/dotfiles
Log | Files | Refs

commit a6a71b38c2a3057be7bf8ffe1340aa4c31005966
parent e80652e5a941cf81ef32249c0926a1c72df31cc6
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Mon,  8 Feb 2016 03:23:39 +0200

bin: Add script to notify about battery level

Diffstat:
bin/check-bat.sh | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/bin/check-bat.sh b/bin/check-bat.sh @@ -0,0 +1,6 @@ +WARN_LEVEL=$1 +CURRENT_LEVEL=$(cat /sys/class/power_supply/BAT0/uevent | grep CAPACITY= | cut -d '=' -f 2) + +if [ $CURRENT_LEVEL -lt $WARN_LEVEL ]; then + /usr/bin/notify-send "Low Battery" "Charge level is at $CURRENT_LEVEL%" +fi