I hard-coded everything in the script. That includes the played sound, /usr/share/sounds/question.wav, and how to play it, with aplay, which can only play raw formats. You can modify both lines "aplay /usr/share/sounds/question.wav" (and even play a different sounds, depending on whether the battery became low or high). For example, to play the far more noticeable /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga file with paplay (which can play that file format and more):
paplay /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga

We can change the script so that the file(s) to play, the two thresholds, the check period, ... become arguments. Since you will not run the command by hand, it does not look very useful to do so, in my opinion.

notify-send (on the two previous lines) is supposed to send a notification. It works on GNOME Shell. I am surprised it does not work on MATE. Try to execute the following command in a terminal emulator:
$ notify-send banana
Is "banana" displayed in a notification?  If not, any error message?

Reply via email to