Skip to content

Instantly share code, notes, and snippets.

@funkymonkeymonk
Created February 26, 2015 19:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funkymonkeymonk/cf35fbffd9cedf308d72 to your computer and use it in GitHub Desktop.
Save funkymonkeymonk/cf35fbffd9cedf308d72 to your computer and use it in GitHub Desktop.
A function for sending notifications from bash to the OSX notification center
notify() {
body=${1-'Demo notification\nsyntax: notify "title" "body"'}
title=${2-'Terminal notification'}
osascript -e "display notification \"${body//\"/\\\"}\" with title \"${title//\"/\\\"}\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment