Created
November 21, 2014 19:13
-
-
Save stoph/5523ca387dde4d7efdcc to your computer and use it in GitHub Desktop.
Add osx notifications to CLI scripts
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
#!/bin/sh | |
# Save this as /usr/local/bin/notify | |
# chmod +x /usr/local/bin/notify | |
# | |
# Usage: | |
# sleep 2;notify "I'm awake" Sleepy | |
if [ "$1" ] | |
then | |
MESSAGE="$1" | |
else | |
MESSAGE="Done" | |
fi | |
if [ "$2" ] | |
then | |
TITLE="$2" | |
else | |
TITLE="Notify" | |
fi | |
/usr/bin/osascript -e "display notification \"$MESSAGE\" with title \"$TITLE\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment