Last active
December 26, 2015 07:29
-
-
Save rummelonp/7115198 to your computer and use it in GitHub Desktop.
通知センターに通知するやつ
This file contains hidden or 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
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