Skip to content

Instantly share code, notes, and snippets.

@penryu
Last active May 29, 2018 16:32
Show Gist options
  • Save penryu/f86f060fd9e4ecd93b62756cd4995f57 to your computer and use it in GitHub Desktop.
Save penryu/f86f060fd9e4ecd93b62756cd4995f57 to your computer and use it in GitHub Desktop.
#!/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
#!/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