Last active
July 19, 2022 18:58
-
-
Save reganto/addd1853ffc0dcf0d3944cd068c37ed7 to your computer and use it in GitHub Desktop.
This file contains 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 | |
while true | |
do | |
export DISPLAY=:0.0 | |
battery_level=`cat /sys/class/power_supply/BAT0/capacity` | |
battery_status=`cat /sys/class/power_supply/BAT0/status` | |
if [ $battery_status = "Charging" ] && [ $battery_level -ge 85 ]; | |
then | |
# kdialog --msgbox "Battery fully charged" 5 # for KDE | |
notify-send -u critical "Battery fully charged" # for Gnome | |
fi | |
sleep 120 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tested it on Ubuntu 20.04 without "unknown status check" and it works. thank you for your contribution.