Created
June 23, 2015 03:24
-
-
Save evamvid/a7231fca5e549d88871e to your computer and use it in GitHub Desktop.
Revisions
-
evamvid created this gist
Jun 23, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/bin/bash cat /sys/class/power_supply/BAT0/status OUTPUT="$(cat /sys/class/power_supply/BAT0/status)" echo "${OUTPUT}" if [ "${OUTPUT}" = "Charging" ] || [ "${OUTPUT}" = "Unknown" ]; then echo charging or full elif [ "${OUTPUT}" = "Discharging" ]; then notify-send -i /home/evamvid/Documents/Programming/OokiNoUse/power25.png "Hey there brother" "plug it in" COUNTER=0 while [ "$COUNTER" -le 12 ] do cat /sys/class/power_supply/BAT0/status OUTPUT="$(cat /sys/class/power_supply/BAT0/status)" echo "${OUTPUT}" if [ "${OUTPUT}" = "Charging" ] || [ "${OUTPUT}" = "Unknown" ]; then exit elif [ "${OUTPUT}" = "Discharging" ]; then COUNTER=$(($COUNTER+1)) echo $COUNTER sleep 1 fi done fi