TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show OS X notifications when long running command finishes

3 pointsby ejpastorinoalmost 9 years ago

5 comments

nathan_longalmost 9 years ago
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>
oregondanalmost 9 years ago
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.
stormbrewalmost 9 years ago
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.
chmaynardalmost 9 years ago
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.
freeslugsalmost 9 years ago
how would this work with terminal instead of iterm2?