Last active
May 29, 2018 16:32
-
-
Save penryu/f86f060fd9e4ecd93b62756cd4995f57 to your computer and use it in GitHub Desktop.
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/bash -e | |
TITLE=`basename $0` | |
while getopts "hs:t:" opt; do | |
case "${opt}" in | |
s) SUBTITLE="${OPTARG}";; | |
t) TITLE="${OPTARG}";; | |
*) echo "Usage: $0 [-t TITLE] [-s SUBTITLE] BODY" && exit 1;; | |
esac | |
done | |
shift $((OPTIND-1)) | |
BODY="$@" | |
osascript -l JavaScript <<EOF | |
var app = Application.currentApplication(); | |
app.includeStandardAdditions = true; | |
app.displayNotification( | |
"${BODY}", { | |
withTitle: "${TITLE}", | |
subtitle: "${SUBTITLE}"} | |
); | |
EOF |
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/bash | |
TITLE=`basename $0` | |
MESSAGE="The connect closed unexpectedly." | |
ssh proxy | |
clear | |
echo $MESSAGE | |
notify.sh -t "$TITLE" "$MESSAGE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment