TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show OS X notifications when long running command finishes

3 点作者 ejpastorino将近 9 年前

5 条评论

nathan_long将近 9 年前
A much lower-effort solution, if you can hear: &quot;some_command; say &#x27;done&#x27;&quot;. (Replace &#x27;say&#x27; with &#x27;espeak&#x27; on Linux.)<p>I personally went kinda crazy in this direction, and made &#x27;judge some_command&#x27;, which, depending on exit status, runs either &#x27;yay&#x27; or &#x27;boom&#x27;, themselves custom commands which play clapping or explosion sounds.<p>So I can do &#x27;judge run_tests&#x27; or &#x27;run_tests; judge&#x27; and hear what happened. (The latter form is nice if I realize after the command started that I want notification - I just type it and hit enter while waiting for the first command to finish.)<p><a href="https:&#x2F;&#x2F;github.com&#x2F;nathanl&#x2F;.dotfiles&#x2F;blob&#x2F;64b0ae9e53c0bbf9c5b6b162754237251cedbac4&#x2F;zsh&#x2F;aliases#L65-L91" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;nathanl&#x2F;.dotfiles&#x2F;blob&#x2F;64b0ae9e53c0bbf9c5...</a>
oregondan将近 9 年前
There&#x27;s also noti (<a href="https:&#x2F;&#x2F;github.com&#x2F;variadico&#x2F;noti" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;variadico&#x2F;noti</a>), which I use. Just add noti to the beginning of a command you run (i.e. &quot;noti eb deploy&quot;), and you&#x27;ll get a notification when it finishes.
stormbrew将近 9 年前
I have a bell character in my prompt and my terminals (on osx and Linux) configured to do visual signaling on bell instead of making noise. This works even with remote hosts and uniformly across platforms.
chmaynard将近 9 年前
Left as an exercise for the reader: learn how to do this in bash, decide what to name the script file, figure out what the PS1 line does, and so on.
freeslugs将近 9 年前
how would this work with terminal instead of iterm2?