Created
February 10, 2020 20:18
-
-
Save neerajvashistha/1f4a41f709909eb92663964725190812 to your computer and use it in GitHub Desktop.
after 90 notify
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/sh | |
max=90 | |
while true | |
do | |
battery_percentage=`acpi -b | egrep 'Charging|Full'|grep -v 'Discharging' | grep -P -o '[0-9]+(?=%)'`; | |
if [ "$battery_percentage" -gt "$max" ] | |
then | |
echo $battery_percentage | |
notify-send 'Laptop Battery Charged' "Please Disconnect Laptop Battery is charged" | |
fi | |
sleep 300 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment