Created
October 23, 2013 03:54
-
-
Save syui/7112389 to your computer and use it in GitHub Desktop.
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
## zsh/growl integration: any command that takes longer than 5 seconds | |
## will trigger a growl notification when it completes. | |
## https://github.com/patbenatar/dotfiles/blob/master/zsh/growl.zsh | |
if growlnotify -h &>/dev/null; then | |
preexec() { | |
zsh_growl_cmd=$1 | |
zsh_growl_time=`date +%s` | |
} | |
precmd() { | |
if (( $? == 0 )); then | |
# message | |
zsh_growl_status=done\!\! | |
else | |
zsh_growl_status=fail | |
fi | |
if [[ "${zsh_growl_cmd}" != "" ]]; then | |
# time | |
if (( `date +%s` - ${zsh_growl_time} > 3 )); then | |
growlnotify -m ${zsh_growl_cmd} ${zsh_growl_status} | |
fi | |
fi | |
zsh_growl_cmd= | |
} | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment