Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Last active December 26, 2015 07:29
Show Gist options
  • Save rummelonp/7115198 to your computer and use it in GitHub Desktop.
Save rummelonp/7115198 to your computer and use it in GitHub Desktop.
通知センターに通知するやつ
function notification() {
local title
local subtitle
local text=""
while [ "$1" != "" ]; do
case "$1" in
-t)
shift
title="$1"
;;
-s)
shift
subtitle="$1"
;;
*)
text+=" $1"
esac
shift
done
local command="display notification \"$text\""
if [ -n "$title" ]; then
command+=" with title \"$title\""
if [ -n "$subtitle" ]; then
command+=" subtitle \"$subtitle\""
fi
fi
echo "$command" | osascript
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment