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 switch back). Is there an option somewhere in iTerm to turn on notifications or is it something I'm supposed to type at the end of a command in the terminal? If the latter, is it possible to add an alert once process has started (for example if I realize it's going to take longer than I initially expected, I'm bad at guessing).
相关问题
- Xcode debugger displays incorrect values for varia
- Is there a way to report errors in Apple documenta
- Advice for supporting both Mac and Windows Desktop
- Avoid cmake to add the flags -search_paths_first a
- installing packages for python 3
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
- Automator: How do I use the Choose from List actio
- ImportError: No module named twisted.persisted.sty
- How can I vertically align my status bar item text
- Emacs/xterm color annoyance on Linux
There is an OSS tool called noti.
You can easily install it with
brew install noti
and start using it just by prefixing your command withnoti
likenoti sleep 3
.iTerm2
supportsGrowl
notifications. You can turn it on in each profile settings.Select a profile in
Preferences…
->Profiles
. Then inTerminal
tab there is an optionEnable Growl Notifications
.Remember to also enable
iTerm
notifications inGrowl
preferences.If you want to get notification for a given process you could try to experiment with
Triggers
. You define triggers inAdvanced
tab in a profile settings. In this way you may assign a Growl notification to a particular output of your process (regexp).You could for example do:
And connect trigger to "end-of-my-process" message.
Update
Read more about triggers on iTerm2.com.
You can also use
terminal-notifier
which use mac os system notifications. To install it via Home brew just:Then if you want to display notification when your job/process is done use something like this
And this display like this:
You can also change sound and icon of notifications. More info in github repo: https://github.com/julienXX/terminal-notifier
And you can always use the
say
command.Usually when you are running a long process inside the terminal and want to get updated you can simply use this command to speak out things like
done
orerror
orbazinga
.This command builds a java spring app, and takes a long long time, and it will speak out
done
after the process is complete.Notify on an already running process
Shortcut: ⌥⌘ A or:
Edit -> Marks and Annotations -> Alerts -> Alert on next mark
:
iTerm
will literally keep an eye (on the top right corner) of your terminal. Once the command is finished, it will contact theNotification Center
.Why?
We already launched the command. We underestimated the time needed for completion, we don't want to cancel it, and we refuse to sit down and watch it. e.g. a
brew update
after a long time!Requirements
iTerm: Shell Integration:
iTerm2 -> Install Shell Integration
Note that the integration will not show notifications until iTerm2 is restarted.
You can add any one of the following after any command, with a semi-colon in between the command and it:
or, if you like Notification Centre
You can also make an alias in your profile, called
notify
and add that at the end of your command. So, in your login profilethen
Or, if you started your command and it is "hanging", just type
notify
and hitEnter
and it will run yournotify
alias at the end, whne the command has finished, e.g.