#!/bin/bash -e state=`echo acpi -b` batcheckr=`$state | cut -c30-31` batlow=11 if $state | grep -qw Charging; then # C for charging echo "C" exit else if $state | grep -qw Full; then # F for full battery echo "F" echo `/usr/bin/notify-send 'Battery' -t 0 -u normal 'Battery Full' -h int:x:80 -h int:y:582 -t 3000 -i ~/bin/battery.png` exit else $state | cut -c30-32 if [ $batcheckr -lt $batlow ]; then echo `/usr/bin/notify-send 'Battery' -t 0 -u critical 'Battery LOW' -h int:x:80 -h int:y:582 -i ~/bin/battery.png` fi exit fi fi