Use Growl Notifications to Alert When Command Line Tasks Have Completed
A recent tip covered how to announce when a command line task finished by using OS X’s text-to-speech abilities. The obvious downside to that method is the sound makes it less useful to those who are using Macs in quiet environments like offices, schools, or libraries. An alternate solution is to use growlnotify to create a silent notification when a command line task has finished.
You will need the following for this to work:
- Growl ($2 App Store) or Growl Fork (free download)
- growlnotify installed
Assuming both Growl and growlnotify have been installed, append growlnotify to the end of another command and use the -m flag to specify the notification message to use after the initial command has finished running. For example:
make install && growlnotify -m "Install Completed"
The Growl message “Install Completed” will appear when make install has finished running.
Growl also makes it simple to send notifications to other hosts running growl, this can be done with the -H flag and by specifying an IP address. This is helpful if you’re compiling something large on a desktop Mac and want to send the completion notification to a MacBook Air while you’re working elsewhere.
The notification icon and other details can be modified through growlnotify command as well, use the –help flag to see all the options.
Thanks to Theo & Jason for the tip idea
normal ! cause you need to have “XCode” installed on your Mac…for launching the “Make command”….the article missed this information !
When I try and run these commands after installing growl and growlnotify all I get is make: command not found
make is just a sample command, it’s for building source code.
Use any command followed by && growlnotify -m “Message”
Just to inform you, this may not give the desired effect every time.
In the example && is logical AND, which means that if make install exits with a nonzero status, growlnotify will not be triggered.
This guarantees that grownlnotify will triggered after make exits no matter what the exit status:
make install; growlnotify -m “Install Completed”
Or – a bit more advanced:
make install && growlnotify -m “Install Completed” || growlnotify -m “Install ERROR!!!!!!!!!11111”