Last active
March 18, 2017 06:05
-
-
Save paragasu/23a6e0d7f95464246170465354fef25c to your computer and use it in GitHub Desktop.
Display notifcation when battery reach critical level.
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 characters
#!/bin/bash | |
# Author Jeffry L. <[email protected]> | |
# display notification when battery reach critical level | |
CHARGE=`acpi -b | cut -d, -f2` | |
VLC=`ps -e | grep vlc` | |
echo $CHARGE | |
# only play cvlc if no process exists yet | |
if [ $CHARGE == "5%" ]; then | |
notify-send --expire-time=15000 "Battery Low!" | |
fi | |
# battery full | |
if [ $CHARGE == "95%" ]; then | |
notify-send --expire-time=15000 "Battery Full." | |
fi | |
~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment