Skip to content

Instantly share code, notes, and snippets.

@nicksieger
Created August 26, 2009 18:50
Show Gist options
  • Save nicksieger/175715 to your computer and use it in GitHub Desktop.
Save nicksieger/175715 to your computer and use it in GitHub Desktop.
save_last_status()
{
laststatus=$?
}
PROMPT_COMMAND=save_last_status
_growl_prompt_command()
{
eval $PREV_PROMPT_COMMAND
growlnotify -n Shell -m "$PROMPT_MEMO exited with $laststatus" Shell
PROMPT_COMMAND=$PREV_PROMPT_COMMAND
PREV_PROMPT_COMMAND=
PROMPT_MEMO=
}
growldone()
{
PREV_PROMPT_COMMAND=$PROMPT_COMMAND
PROMPT_COMMAND=_growl_prompt_command
if [ $# -gt 0 ]; then
PROMPT_MEMO=$@
else
PROMPT_MEMO=Command
fi
}
# Usage:
# growldone Download && curl -O http://www.pr0n4us.com/some-crazy.flv
# ...
# => [Download exited with 1]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment