Use Growl Notifications to Alert When Command Line Tasks Have Completed

May 17, 2012 - 4 Comments

Growl Notification sent from the command line with growlnotify

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:

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

Enjoy this tip? Subscribe to the OSXDaily newsletter to get more of our great Apple tips, tricks, and important news delivered to your inbox! Enter your email address below:

Related articles:

Posted by: William Pearson in Command Line, Mac OS X, Tips & Tricks

4 Comments

» Comments RSS Feed

  1. xofer says:

    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″

  2. Paul says:

    When I try and run these commands after installing growl and growlnotify all I get is make: command not found

    • duarb says:

      make is just a sample command, it’s for building source code.

      Use any command followed by && growlnotify -m “Message”

  3. Tony says:

    @Paul

    normal ! cause you need to have “XCode” installed on your Mac…for launching the “Make command”….the article missed this information !

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates