beep when ready

The Ubuntu Incident

Problem
Sometimes I launch a script and if it takes too much time to finish, I leave the machine alone. I do something else but I check back from time to time to see if it has finished. It would be nice if I could get an audio notification when the job is done.

Idea
Here it is:

$ ./slow_operation.sh; beep

Implementation
There is a package called “beep” that should do it but it was mute on my system, so I came up with an own solution. First, you need a short audio file. Here is mine: alert.wav. Download it and put it in the directory $HOME/bin. Make sure $HOME/bin is in your PATH.

Then add the following lines to your ~/.bashrc file:

#uncomment the next 2 lines to add $HOME/bin to your PATH
#PATH=$PATH:$HOME/bin
#export PATH

alias beep="mplayer -ao alsa $HOME/bin/alert.wav &>/dev/null"

Test
Open a new…

View original post 8 more words

Advertisements
By yashjhunjhunwala