Show OS X notification when long running cmd finishes and terminal not in focus
frantic.im
frantic.im
I've also used a similar cheap hack to listen to web traffic... Just write a bell character to your server log when something interesting happens, then `tail -f` the log file for live data sonification!
Does zsh have a way to see how long the last command took? You could at least have this only do the check if the command took more than one or two seconds. That would cut out a lot of the unnecessary checks.
I think checking the command runtime would be a mistake. If you expect the command to take a long time, and it finished in just a second or two, you probably want to be notified immediately rather than eventually wondering many minutes later why you weren't. And if you expect the command to take only a second or two, you are a lot less likely to be tabbing away, so you won't be notified anyway.
What is the app in the foreground, in the screenshot at the bottom? Looks like a multi-tabbed text editor?