Skip to content

Instantly share code, notes, and snippets.

@neerajvashistha
Created February 10, 2020 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neerajvashistha/1f4a41f709909eb92663964725190812 to your computer and use it in GitHub Desktop.
Save neerajvashistha/1f4a41f709909eb92663964725190812 to your computer and use it in GitHub Desktop.
after 90 notify
#!/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