Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## zsh/growl integration: any command that takes longer than 5 seconds
- ## will trigger a growl notification when it completes.
- case $OSTYPE in
- darwin*)
- notify="growlnotify"
- notifyo=$notify" -m"
- ;;
- linux*)
- notify="notify-send"
- ;;
- esac
- if which $notify > /dev/null 2>&1; then
- preexec() {
- zsh_growl_cmd=$1
- zsh_growl_time=`date +%s`
- }
- precmd() {
- if (( $? == 0 )); then
- zsh_growl_status=done
- else
- zsh_growl_status=fail
- fi
- if [[ "${zsh_growl_cmd}" != "" ]]; then
- if (( `date +%s` - ${zsh_growl_time} > 5 )); then
- $notify ${zsh_growl_cmd} ${zsh_growl_status}
- fi
- fi
- zsh_growl_cmd=
- }
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement