Grom

3 votes
Dependency :
compile ":grom:0.3.0"

Documentation Source Issues

Summary

Grom (Dutch for Growl) sends Grails notifications to Mac OS X and Windows using Growl, or to Linux using libnotify.

Installation

In order to add unified messaging to your project, add the plugin as a compile time dependency:

grails.project.dependency.resolution = {
    …
    plugins {
        compile ':grom:0.2.5'
        …
    }
}

Additionally you can use the legacy way to add dependencies:

grails install-plugin grom

In addition to send default notifications you can also send custom notifications by Grom-ing a String:

"bootstrapping application".grom()

If you, at some point in the future, decide to remove the from plugin, either before packaging to a production environment or some other reason. Keep in mind that any custom Grom-ing will break your application as the grom() method will not be available. This can be resolved by using something like:
class MyController {
        def myAction {
                if (String.metaClass.getMetaMethod("grom")) "my action is being called".grom()
        }
}

or

class BootStrap {
	def init = { servletContext ->
		if (String.metaClass.getMetaMethod("grom")) "bootstrapping application".grom()
		…
	}

def destroy = { if (String.metaClass.getMetaMethod("grom")) "stopping application...".grom() … } }

The Grom plugin can be in a production package, as it will just not do anything if no notification agent is present. It may spit out a warning to the logfile when the application is bootstrapping (for example that libnotify is not available and hence notifications will not be shown), but that can be ignored.

Description

Grom is Dutch for Growl, which already gives away a hint on what this plugin does. This plugin sends grails notifications to a unified notifications daemon. It is currently compatible with Growl for Mac OS X, Growl for Windows and Notify OSD for Linux.

Development of this plugin was inspired by N.A.D.D. Neutralizer, a plugin to decrease development latency by using the speech synthesizer to notify you when a project was up and running. While this was very useful at the time and certainly has it's uses (me and my colleagues even gave feedback to improve support), it was a bit too obtrusive for our liking as it started iTunes if not running and at some point you just wished it stopped talking.

So what would be better than to use Growl instead, as it is unobtrusive and the whole reason for running a notification daemon is to unify messaging into a single location. So I developed Grom initially for Growl on Mac OS X, and I added multi-platform support later by including support for Growl for Windows and Notify OSD for Linux which is by default shipped with Ubuntu.

More screenshots are available in the Screenshots tab.

Mac OS X

Most people I know already run Growl as a notification daemon, so I'm pretty sure I'm not telling you anything new here. In order to have any benefit from this plugin you should install Growl to centralize messages. In case you're not familiar with Growl, many Mac applications already support Growl integration so it will be an overall improvement to your Mac experience to have Growl installed. With or without using this plugin.

note as of Mountain Lion Apple has added a default unified notifications agent: Notification Center. Unfortunately Grom will not support Notification Center by default, as it is only available to applications which are distributed through Apple's AppStore. However, you can still use Growl together with Notification Center. The Growl team has even provided a switch to forward Growl notifications to Notification Center which will show all Grom notifications in Notification Center instead.

Linux / Ubuntu

The unified messaging implementation in Ubuntu provided through Notify OSD. I am not entirely sure if it is also available for other distributions, but as Ubuntu is by far the most common distribution used in corporate organizations and home desktop installations, I chose to support Notify OSD. Notify OSD is by default available in (the latest releases of) Ubuntu, however the client binary is not provided so you need to install that to get Grom working on Ubuntu. To do that, just install libnotify-bin and you're good to go:

apt-get install libnotify-bin

While Grom will now work, there are a number of limitations with the default implementation of Notify OSD on Ubuntu:

  • the timeout parameter is broken (notifications stay on the screen too long)
  • the notifications cannot be customized
  • grouping of notifications does not work
Luckily the first two limitations can be solved by using the Leolik patch for Notify OSD. Unfortunately the latter does not seem to be getting picked up anytime soon. Perhaps is more people voted the issue up, as support for grouping is already integrated into this plugin.

Windows

Growl for Windows basically is a port of Growl for Mac OS X and brings unified messaging to Windows. To have any benefit from this plugin, you should install Growl for Windows and the Microsoft .NET Framework (v2.0 or higher)

If you do not have any of the following notification daemons installed or if you're using a platform which is not -yet?- supported, the Grom plugin will just not send any notifications. Which means you can keep it in a project repository where multiple people work on the same project, without breaking the project on machines that do not support unified notifications.