I am executing every now and then some python scripts which take quite long to execute.
I execute them like this:
$ time python MyScript.py
How can I play a sound as soon as the execution of the script is done?
I use Ubuntu 10.10 (Gnome desktop).
Append any command that plays a sound; this could be as simple as
or as complex as
(Commands assume pulseaudio is installed; substitute your sound player, which will depend on your desktop environment.)
Just pick a sound on your hard drive, and put a command to play it right after the command you're waiting on; they'll happen sequentially:
(You can use any player, naturally). I have a script called
It's really simple, so if you want to make your own you can base it on this (mine requires
You can also make this happen automatically.
I will show you how in
The essence looks like this:
You can also make it only do it if the program was Python, e.g.
If you're using GNOME Terminal, I would also point you to Flashing GNOME Terminal. It's a patch I wrote that makes the terminal blink when a command is done, so you can Alt-Tab to something else, then it lets you know when it's done.