diff --git a/README.md b/README.md index c35184a..5b74533 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # linux-battery-notifier Sends notification when battery is above 95 to unplug the AC adapter and when battery is at 30, 40 and below 20 to plug-in AC adapter again. +With this branch I also play notification sounds, because it doesn't show notifications. +If we are in fullscreen mode let's say you are wathing a youtube video, +you won't get any notifications earlier but now I sorted it. ## Steps to run this @@ -9,7 +12,7 @@ Sends notification when battery is above 95 to unplug the AC adapter and when ba sudo apt install acpi ``` - Make file executable -- If any of your folder/directory name contains space like 'My Things' while writing file path write fodler name as +- If any of your folder/directory name contains space like 'My Things' while writing file path write folder name as - My\ Things - Else You might get an error of no such file or directory ``` diff --git a/battery-notifier.sh b/battery-notifier.sh index da4d6e4..d8d8e99 100755 --- a/battery-notifier.sh +++ b/battery-notifier.sh @@ -23,19 +23,29 @@ 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 # break # sleep 180 - elif [ $battery_level == 30 ]; then + 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 # break - # sleep 180 + sleep 200 elif [ $battery_level == 40 ]; then notify-send -u critical "Its ${battery_level}%" -i face-angel + # To get the sound notification + aplay sounds/mixkit-bell-notification-933.wav + # break - # sleep 180 + sleep 180 elif [ $battery_level -ge 95 ]; then - notify-send -u critical "Thank you!!!" "You did an excellent job, Keep it up." -i face-angel - sleep 300 # sleep as charging is above 95 + 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 + sleep 90 # sleep as charging is above 95 fi fi sleep 5 #wait for 300 seconds before checking again diff --git a/sounds/mixkit-bell-notification-933.wav b/sounds/mixkit-bell-notification-933.wav new file mode 100644 index 0000000..7e3d6ad Binary files /dev/null and b/sounds/mixkit-bell-notification-933.wav differ diff --git a/sounds/mixkit-happy-bells-notification-937.wav b/sounds/mixkit-happy-bells-notification-937.wav new file mode 100644 index 0000000..8902bd5 Binary files /dev/null and b/sounds/mixkit-happy-bells-notification-937.wav differ diff --git a/sounds/mixkit-melodical-flute-music-notification-2310.wav b/sounds/mixkit-melodical-flute-music-notification-2310.wav new file mode 100644 index 0000000..c97d89a Binary files /dev/null and b/sounds/mixkit-melodical-flute-music-notification-2310.wav differ diff --git a/sounds/mixkit-wrong-answer-fail-notification-946.wav b/sounds/mixkit-wrong-answer-fail-notification-946.wav new file mode 100644 index 0000000..87b6e1e Binary files /dev/null and b/sounds/mixkit-wrong-answer-fail-notification-946.wav differ