Skip to content

Instantly share code, notes, and snippets.

@morygonzalez
Forked from youpy/.zshrc
Created February 2, 2012 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save morygonzalez/1722667 to your computer and use it in GitHub Desktop.
Save morygonzalez/1722667 to your computer and use it in GitHub Desktop.
play music during command execution
p() {
local pid exit
# http://www.filesonic.com/file/703099021
afplay ~/Music/Nyan\ Cat.mp3 &
pid=$!
trap "kill -9 $pid" INT
command $*
exit=$?
kill -9 $pid
trap INT
return $exit
}
#compdef - p
shift words
(( CURRENT-- ))
_normal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment