LoginSignup
1
3

More than 5 years have passed since last update.

iterm2での作業が終わったら自動でgrowlが通知してくれる機能を実装してみる

Posted at

Growl Notification from iTerm 2というサイトをたまたま発見。そういえば時間がかかる処理を待ってる間実際他のことをしていることが多いし定期的にターミナルをチェックするのも面倒。終わった瞬間に通知してくれたらいいなと思っていたところ。中々役に立ちそうな実装だったので実践してみることに。

まずはgrowlを開いてitermとの連携をONに。

Screen Shot 2017-01-22 at 12.25.58 PM.png

次にmvim ~/.bash_profileでバッシュプロファイルを開いて以下を追加。

# A bash function to display a growl notification using iTerm's magic
# escape sequence. This version will work under screen.
growl() { echo -e $'\e]9;'${1}'\007' ; return ; }

これで準備完了。

あとはコマンドを打つ際にrunfoo ;growl "foo finished"と打つだけで処理が終わった際にgrowl経由で通知してくれる。

1
3
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
1
3