Skip to content

Instantly share code, notes, and snippets.

@enolan
Created March 4, 2017 02:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enolan/a2d475e76c03011cd39cd21962f73112 to your computer and use it in GitHub Desktop.
Save enolan/a2d475e76c03011cd39cd21962f73112 to your computer and use it in GitHub Desktop.
Bash scripts for making a noise when a process finishes
# I often start some command that takes a while (compiling, building containers, model training),
# then go and fuck around on the internet while waiting for it to finish. These scripts play the
# SCV "job's finished" sample from StarCraft when the process exits :)
# Usage:
# $ thing-that-takes-a-while ; talk
# Or, if you realize the thing's going to take a while after it starts:
# $ waitprocess $PID
# You need an mp3 in ~/jobs-finished.mp3 for this to work.
alias talk="echo job\'s finished!;while true;do mplayer -nolirc -really-quiet ~/jobs-finished.mp3;sleep 10;done"
function waitprocess { while [ -d /proc/$1 ] ; do sleep 1 ; done ; talk }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment