How do I make iTerm terminal notify me when a job/process is complete?

前端 未结 7 1785
[愿得一人]
[愿得一人] 2020-12-12 13:00

A notification center notification would be ideal but growl, bounce dock, sound, etc would be fine, too (or if this can only be done in Terminal.app I\'d be willing to switc

7条回答
  •  庸人自扰
    2020-12-12 13:17

    Install the iTerm2 shell integration

    curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash
    

    Execute your command and concatenate the attention app, e.g.

    ./task && ~/.iterm2/it2attention once
    

    It'll cause the iTerm app to bounce it's icon once the job is complete.

    You also have other attention options:

    $ .iterm2/it2attention -h
    Usage:
      it2attention start
        Begin bouncing the dock icon if another app is active
      it2attention stop
        Stop bouncing the dock icon if another app is active
      it2attention once
        Bounce the dock icon once if another app is active
      it2attention fireworks
        Show an explosion animation at the cursor
    

提交回复
热议问题