When we run a command that takes a while such as source compile or brew upgrade, we usually do other things such as web searching rather than watching the command running the whole time.
Is there any possible way that I can get notified once the command is done?
brew upgrade | afplay /System/Library/Sounds/Submarine.aiff -v 10
I tried with afplay on Mac as above but the problem is a) stdout is not shown due to the pipe, b) it plays the sound right after the command starts to run rather than waiting until "brew upgrade" is finished.
Any suggestions please?
Unplug any headphones or external speakers. On your Mac, choose Apple menu > System Preferences, click Sound , then click Output. Make sure “Internal Speakers” is selected, the “Output volume” slider is not all the way to the left, and the Mute checkbox is not selected.
The Terminal command caffeinate works on every Mac, is instant, and is easy to stop. And you don't even have to remember how to spell the word: just type "caf" and hit tab . The Mac will complete the word for you. It's effective, and it makes you look way cooler than you are.
On the menu go to Terminal > Window Settings. In the Terminal Inspector window click on the drop-down list and select Emulation. Un-check the "Audible Bell" option. (You can also set "visible bell" which will cause your terminal to flash instead of beep)
brew upgrade && say brew upgrade done
leverage the say
command and get a custom voice notification
general example:
YOUR_COMMAND && say YOUR_COMMAND done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With