assign EPICGROWL_VERSION 1.3.1 # Pipe (one of the default epic scripts) used to grab output from the exec command load pipe # Suppress output from execs named EPICGROWL on ^exec_exit "EPICGROWL *" # Get the terminal program's name assign TERMINAL_APP $0 # Reset other_highlights assign -OTHER_HIGHLIGHTS # Use this command when executing a Applescript inside of epic assign EXEC_COMMAND \ exec -name EPICGROWL osascript -e # Applescript to register epicgrowl with Growl assign REG_WITH_GROWL \ tell application "GrowlHelperApp" to register as application "EpicGrowl" all notifications {"Messages"} default notifications {"Messages"} icon of application "Terminal" # Applescript to display a notification for msg received assign MSG_NOTIFY \ tell application "GrowlHelperApp" to notify with name "Messages" title "$$0 @ $$servername()" description "$$strftime(%D @ %r)$$chr(13)$$quoteSlashesQuotes($1-)" application name "EpicGrowl" # Applescript to display a notification for a public channel message assign PUBLIC_NOTIFY \ tell application "GrowlHelperApp" to notify with name "Messages" title "$$0 @ $$1$$chr(13)$$servername()" description "$$strftime(%D @ %r)$$chr(13)$$quoteSlashesQuotes($2-)" application name "EpicGrowl" # Append this when you want the notification to be sticky assign WITH_STICKY \ with sticky # Applescript to check if your TERMINAL_APP is the front most app # osascript -e 'return frontmost of application "$TERMINAL_APP"' assign FRONTMOST_APP \ osascript -e 'return path to frontmost application as Unicode text' | grep ${TERMINAL_APP}.app:\$ # An alias to quote single quotes , double quotes, and slashes alias quoteSlashesQuotes { ^assign function_return $*; ^assign function_return $sar(g/\\/\\\\/$function_return); ^assign function_return $sar(g/'/'\\''/$function_return); ^assign function_return $sar(g/"/\\"/$function_return); } # Register epicgrowl with Growl eval $EXEC_COMMAND '$REG_WITH_GROWL' # If you're away make the notification sticky otherwise display it a regular manner on #^msg 1 "*" { if ( isaway() ) { eval $EXEC_COMMAND '$MSG_NOTIFY $WITH_STICKY'} { eval $EXEC_COMMAND '$MSG_NOTIFY'} } on #^public 1 "*" { # if we find your nickname or other_highlights in a public channel message display a notification if ( match( *$servernick()* $2- ) || rmatch( \"$2-\" $OTHER_HIGHLIGHTS ) ) { if ( isaway() ) { eval $EXEC_COMMAND '$PUBLIC_NOTIFY $WITH_STICKY'} { # If away make notification sticky defer { # I hope this fixes a problem with epic sending notices if ( [$1] != chanwin() || pipe($FRONTMOST_APP) == [] ) { eval $EXEC_COMMAND '$PUBLIC_NOTIFY' } # if not away and you're active channel is not the channel the messsage is coming from or TERMINAL_APP is not the active app display a notification } } } } # Used to unset OTHER_HIGHLIGHTS on ^set "OTHER_HIGHLIGHTS " { assign -$0; echo $0: unset } on ^set "OTHER_HIGHLIGHTS *" { # Used to set OTHER_HIGHLIGHTS if ( [$1] ) { assign highlights $*; @shift(highlights) assign $0 *$sar(/\ /*\ */$unsplit(" " $highlights))* assign -highlights echo $0: $other_highlights # if you're not trying to set OTHER_HIGHLIGHTS this will display the varibles contents } { if ( [$other_highlights] ) { eval echo $0: $other_highlights } { echo $0 not set } } } # Displays epicgrowl version and what terminal app you're using eval echo epicgrowl $EPICGROWL_VERSION loaded for $TERMINAL_APP