Skip to content

Instantly share code, notes, and snippets.

@kattrali
Created March 11, 2011 16:36
Show Gist options
  • Save kattrali/866146 to your computer and use it in GitHub Desktop.
Save kattrali/866146 to your computer and use it in GitHub Desktop.
groovy script for adding Notify OSD alerts to grails events. Save as ~/.grails/scripts/_Events.groovy
// Documentation on Event hooks: http://grails.org/doc/latest/guide/4.%20The%20Command%20Line.html#4.3%20Hooking%20into%20Events
// Inspiration: http://www.anyware.co.uk/2005/2007/05/02/grails-script-notifications-via-growl/
Ant = new AntBuilder()
eventStatusFinal = { msg ->
notifySend(msg)
}
void notifySend(String message) {
Ant.exec(executable:"/usr/bin/notify-send") {
arg(value:"-i")
arg(value:"/my/link/to/grails.png")
arg(value:"Grails")
arg(value:message)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment