LoginSignup
29
28

More than 5 years have passed since last update.

通知センターをTerminal.appから使ってみる

Posted at

ターミナルで時間のかかるスクリプトを実行していたとき、終わったらいい感じに音が出る、とかエラーが出ても音が出る、とかならないかなぁと思っていろいろ調べておりました。

そしたら、いろいろ方法はあるみたいなのですが、terminal-notifierというのがありました。
Homebrewでインストールできます。

brew install terminal-notifier

って感じで。

terminal-notifier -message 'Hello, world!'

ってやってみると、
メッセージを表示できます。

terminal-notifier -title ほげ -message "End of day" -group tokyo -open http://google.com

こうすると、開いた時に開くリンクのURLも指定できたり、

terminal-notifier -message TEST -title TITLE -subtitle SUBTITLE -sound Submarine

これで、デフォルトのサウンドも鳴らせます。

おもしろかった。

29
28
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
29
28