Created
February 1, 2011 14:09
-
-
Save youpy/805901 to your computer and use it in GitHub Desktop.
play music during command execution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
p() { | |
local pid exit | |
# http://www.filesonic.com/file/703099021 | |
play -l ~/Music/Nyan\ Cat.mp3 & | |
pid=$! | |
trap "kill -9 $pid" INT | |
command $* | |
exit=$? | |
kill -9 $pid | |
trap INT | |
return $exit | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#compdef - p | |
shift words | |
(( CURRENT-- )) | |
_normal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment