Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With sounds #2

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Improved the indentation.
  • Loading branch information
OAtulA authored Feb 26, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 18b4f06eb5c6e79d2e47295d160c4d640d25cc35
14 changes: 7 additions & 7 deletions battery-notifier.sh
Original file line number Diff line number Diff line change
@@ -23,28 +23,28 @@ while true; do
if [ "$ac_adapter" == "off" ]; then
if [ $battery_level -le 20 ]; then #check if the battery level is over 90%
notify-send -u critical "Please, kindly plug-in your AC adapter" "Battery level: ${battery_level}%" -i battery-caution
# To get the sound notification
aplay sounds/mixkit-wrong-answer-fail-notification-946.wav
# To get the sound notification
aplay sounds/mixkit-wrong-answer-fail-notification-946.wav
# break
# sleep 180
elif [ $battery_level -le 30 ]; then
notify-send -u critical "Charge it man its ${battery_level}%" -i battery-caution

# To get the sound notification
aplay sounds/mixkit-bell-notification-933.wav
# To get the sound notification
aplay sounds/mixkit-bell-notification-933.wav
# break
sleep 200
elif [ $battery_level == 40 ]; then
notify-send -u critical "Its ${battery_level}%" -i face-angel
# To get the sound notification
# To get the sound notification
aplay sounds/mixkit-bell-notification-933.wav

# break
sleep 180
elif [ $battery_level -ge 95 ]; then
notify-send -u critical "Thank you!!!" "You did an excellent job,Now remove the charger." -i face-angel
# To get the sound notification
aplay sounds/mixkit-melodical-flute-music-notification-2310.wav
# To get the sound notification
aplay sounds/mixkit-melodical-flute-music-notification-2310.wav
sleep 90 # sleep as charging is above 95
fi
fi