I want my computer to play a custom sound file when my battery is low (say 10%). How can I do this? Thanks
You can set up a cron job which will check for battery status after every 5/10 min and then depending on the battery percentage it will play some sound.
To play the sound you can use
To install it
To get battery status from command line you can use this command
Now you can put all these things in a shell script (and also an
so after every 5 mins (You can change this interval) your battery status will be checked and if battery is lower than 10% your provided sound file will be played!
Hope this helps!
One easy way to do this is to add a simple check to your crontab (cron is a system to run things on a regular, user-defined basis in the background.)
First you need to install a command line mp3 player and acpi to be able to read battery state.
From a terminal run the following to install the packages.
Next,while still in the terminal, type
Hit Control-O (the letter) and Enter to save. Hit Control-x to exit
Extra stuff you might want to read...