LoginSignup
40
32

More than 5 years have passed since last update.

ターミナルからmacの通知センターに投稿する

Last updated at Posted at 2016-10-23

ターミナルやシェルスクリプトで何か時間のかかる処理をする際に、完了時やエラー時の通知ができないかなあと思っていた所、terminal-notifierが便利そうだったのでメモ。

terminal-notifierについて

terminal-notifierのインストール

homebrew経由で簡単にインストールできます。

$ brew install terminal-notifier

使い方

オプションで表示メッセージや通知音を指定します。
こちら以外にも、アイコン画像やURLも指定できるようです。

$ terminal-notifier -title "タイトル" -subtitle "サブタイトル" -message "メッセージ" -sound default

こんな風に通知されます。\\ ティロリン! //
スクリーンショット 2016-10-23 23.10.47.png

デフォルトの音を変えても楽しいですね。

# 例)Blow,Bottle,Frog,Funk,Glass,Hero,Morse,Ping,Pop,Purr,Sosumi,Tink
$ terminal-notifier -message "ポッ" -sound Pop
40
32
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
40
32