Created
February 8, 2020 05:33
-
-
Save ahmedalhulaibi/cde9ffed885c06f6af58207148390e53 to your computer and use it in GitHub Desktop.
Git push with salt-n-pepa for zsh using preexec hook
This file contains 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
# install coreutils to get timeout cmd | |
# install sox to get play cmd | |
# install libsox-fmt-mp3 to play mp3 files | |
# legally obtain Push It by Salt-n-Pepa, or get a band and recording studio and re-perform the first 4 seconds and save it in a music file | |
# add the below function to .zshrc | |
# this hook will play the music in the background so as to not interrupt your workflow | |
function preexec() { | |
[[ "$1" =~ "^git push.*" ]] && timeout -k 10s 4s play ~/Music/pushit.mp3 > /dev/null 2>&1 < /dev/null & | |
disown | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment