Friday, March 25, 2011

Growl notifications from other machines

  1. Install growlnotify
  2. Set up public keys so that the other machine can SSH into the Mac without prompting
  3. Add the following to .bashrc:
    get_source_machine() {
      echo ${SSH_CLIENT%% *}
    }
    
    function growlnotify() {
      if [ "$AT_HOME" = "true" ]; then return; fi
      source_machine=$(get_source_machine)
      ssh mihaip@$source_machine /usr/local/bin/growlnotify \
          -n "command-notifier" \
          -m \"[$PWD]\" \"$1\" 2> /dev/null
    }
    
  4. In the Growl PrefPane, the notifications can be styled for the command-notifier "Application." (I like Music Video)