Pas*_*lis 149
捷径:⌥⌘ A或:
Edit -> Marks and Annotations -> Alerts -> Alert on next mark
:
iTerm
真的会留意你的终端(在右上角).一旦命令完成,它将联系Notification Center
.
我们已经启动了命令.我们低估了完成所需的时间,我们不想取消它,我们拒绝坐下来观看它.比如brew update
很久以后!
iTerm2 -> Install Shell Integration
请注意,在重新启动iTerm2之前,集成不会显示通知.
Mar*_*ell 32
您可以在任何命令之后添加以下任何一项,在命令和它之间使用分号:
afplay /System/Library/Sounds/Ping.aiff -v 2
osascript -e 'beep 3'
tput bel
Run Code Online (Sandbox Code Playgroud)
或者,如果您喜欢通知中心
osascript -e 'display notification "Lorem ipsum dolor sit amet" with title "Title"'
Run Code Online (Sandbox Code Playgroud)
您还可以在配置文件中创建别名,notify
并在命令末尾添加该别名.所以,在您的登录配置文件中
alias notify="tput bel"
Run Code Online (Sandbox Code Playgroud)
然后
sleep 10; notify
Run Code Online (Sandbox Code Playgroud)
或者,如果您启动了命令并且它是"挂起",只需键入notify
并命中Enter
,它将notify
在命令结束时运行您的别名,例如
sleep 20
# wait 5 seconds before realising this will take 20 seconds
notify<Enter>
Run Code Online (Sandbox Code Playgroud)
Far*_*lam 29
并且您始终可以使用该say
命令.
通常当你在终端内运行一个很长的进程并希望得到更新时,你可以简单地使用这个命令说出像done
or error
或者这样的东西bazinga
.
mvn clean install; say done
Run Code Online (Sandbox Code Playgroud)
此命令构建一个java spring应用程序,需要很长时间,并且done
在该过程完成后会说出来.
baf*_*baf 15
iTerm2
支持Growl
通知.您可以在每个配置文件设置中打开它.
在Preferences…
- >中选择一个配置文件Profiles
.然后在Terminal
选项卡中有一个选项Enable Growl Notifications
.
请记住还要iTerm
在Growl
首选项中启用通知.
如果您想获得给定流程的通知,可以尝试进行试验Triggers
.您可以在Advanced
配置文件设置的选项卡中定义触发器 通过这种方式,您可以将Growl通知分配给流程的特定输出(regexp).
你可以这样做:
$ mycommand; echo "end-of-my-process"
Run Code Online (Sandbox Code Playgroud)
并将触发器连接到"我的进程结束"消息.
更新
在iTerm2.com上阅读有关触发器的更多信息.
安装 iTerm2 shell 集成
curl -L https://iterm2.com/shell_integration/install_shell_integration_and_utilities.sh | bash
Run Code Online (Sandbox Code Playgroud)
执行您的命令并连接注意力应用程序,例如
./task && ~/.iterm2/it2attention once
Run Code Online (Sandbox Code Playgroud)
作业完成后,它会导致 iTerm 应用程序弹起其图标。
您还有其他关注选项:
$ .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
Run Code Online (Sandbox Code Playgroud)
您还可以使用terminal-notifier
which use mac os 系统通知。要通过 Home brew 安装它,只需:
$ brew install terminal-notifier
Run Code Online (Sandbox Code Playgroud)
然后,如果您想在工作/流程完成时显示通知,请使用以下内容
$ <your job/process command> && echo 'Completed' | terminal-notifier -sound default
Run Code Online (Sandbox Code Playgroud)
这个显示是这样的:
您还可以更改通知的声音和图标。github repo 中的更多信息:https : //github.com/julienXX/terminal-notifier
归档时间: |
|
查看次数: |
21979 次 |
最近记录: |