Have Mac Terminal Audibly Announce The Completion Of A Command [Tip]
Growl notifications are perhaps the best, and arguably the most popular, desktop notification system for OS X Lion. Many app developers integrate support for these notifications in their apps, and OS X Mountain Lion now supports a similar feature. As far as notifications for apps are concerned, Growl handles them well. If, however, you need a notification system for Terminal, one that would tell you when a command has successfully completed, you can add one of your own. Unlike Growl notifications, these are audio alerts that announce when a command has been executed, and make use of the text-to-speech (TTS) utility in Mac. The process requires you to add an additional command and the text that should be announced, at the end of the command you are running. How? Read past the break.
When you execute a command, add the following at the end:
&& say –v Kathy “Type in text to be announced”
where -v switch is followed by which system voice should be used to announce the completed action. If you don’t specify a voice, it will use the default one. The text that is to be announced must be written in double quotes.
This is useful if you’re running a command that is likely to take a long time to complete, or even if you’re just multitasking and don’t feel like watching a black window and neon lettering. Additionally, if you’re just starting out with using Terminal commands to tweak your system, an audio alert might be reassuring, since it sometimes looks as if nothing happened even when a command has worked perfectly.
Since the appendage has to be made at the end of each command you are executing, it gives you the freedom to chose which completed actions need to be announced and which don’t. If you would like an audio alert for all completed commands, then this might be slightly inconvenient. It is, nevertheless, the only quick solution that requires zero installation.