Setting Per Message Display For growlnotify

The Growl forums have moved to Google Groups, this forum is read only.
Locked
braz
Harmless
Posts: 2
Joined: Mon Oct 02, 2006 2:03 pm
Location: Limerick, Ireland
Contact:

Setting Per Message Display For growlnotify

Post by braz »

I was wondering how to programmatically set the notification display for a registered application and how to change it dynamically so to allow differing choices of display plugin depending on the particular message - akin to http://blog.wilsonet.com/mockups/GrowlM ... loring.png but with a wider scope for applications and differing messages.

I attempted to hack growlnotify adding a display (
{ "display", no_argument, NULL, 'D' } ) command line argument and changing a couple of lines to add GROWL_DISPLAY_PLUGIN as an entry to the NSDictionary being sent to the main Growl application. The applicationDisplayPlugin item would be parsed from the command line and set the particular display plugin. I tried using "com.Growl.Bezel" and "com.growl.Smoke" and various other identifiers taken from the particular styles header files and using these as the value for the GROWL_DISPLAY_PLUGIN entry in the dictionary but it does not seem to work. I'm not sure having looked at the source why this isn't working but I'm not really familiar with Growl's architecture so I was wondering if any one could give me a few pointers on what I'm doing wrong ?

Thanks a million, braz

Code: Select all

	// Register with Growl
	NSArray *defaultAndAllNotifications = [[NSArray alloc] initWithObjects:NOTIFICATION_NAME, nil];
	NSDictionary *registerInfo = [[NSDictionary alloc] initWithObjectsAndKeys:
		applicationName,            GROWL_APP_NAME,
		defaultAndAllNotifications, GROWL_NOTIFICATIONS_ALL,
		defaultAndAllNotifications, GROWL_NOTIFICATIONS_DEFAULT,
		icon,                       GROWL_APP_ICON,
		applicationDisplayPlugin,	GROWL_DISPLAY_PLUGIN,
		nil];
	[defaultAndAllNotifications release];

	// Notify
	NSString *clickContext = [[NSProcessInfo processInfo] globallyUniqueString];
	NSNumber *priorityNumber = [[NSNumber alloc] initWithInt:priority];
	NSNumber *stickyNumber = [[NSNumber alloc] initWithBool:isSticky];
	NSDictionary *notificationInfo = [[NSDictionary alloc] initWithObjectsAndKeys:
		NOTIFICATION_NAME, GROWL_NOTIFICATION_NAME,
		applicationName,   GROWL_APP_NAME,
		title,             GROWL_NOTIFICATION_TITLE,
		desc,              GROWL_NOTIFICATION_DESCRIPTION,
		priorityNumber,    GROWL_NOTIFICATION_PRIORITY,
		stickyNumber,      GROWL_NOTIFICATION_STICKY,
		icon,              GROWL_NOTIFICATION_ICON,
		clickContext,      GROWL_NOTIFICATION_CLICK_CONTEXT,
		identifierString,  GROWL_NOTIFICATION_IDENTIFIER,
		applicationDisplayPlugin,	GROWL_DISPLAY_PLUGIN,
		nil];
	[priorityNumber release];
	[stickyNumber   release];
User avatar
The_Tick
Cocoaforge Admin
Posts: 4642
Joined: Thu Dec 02, 2004 6:06 am
Contact:

Post by The_Tick »

Growl does not allow you to set any kind of display options via the application that is talking to GrowlHelperApp.
braz
Harmless
Posts: 2
Joined: Mon Oct 02, 2006 2:03 pm
Location: Limerick, Ireland
Contact:

Post by braz »

Thanks

Do you know if it is possible to make display plugin changes to the Prefpane programatically ? I'm trying to get boodler (http://www.eblong.com/zarf/boodler) to work with Growl for audio in addition to the notification levels but I'd like to set these programmatically rather than manually through the existing Preference Pane in System Preferences.
User avatar
The_Tick
Cocoaforge Admin
Posts: 4642
Joined: Thu Dec 02, 2004 6:06 am
Contact:

Post by The_Tick »

There's not a way via our api. You could modify app tickets directly, but that's not something we support. Growl code is BSD licensed however (3 clause) so you could take some of that as a reference.

In general the thought behind Growl is that the user is in control. Unfortunately in some situations (like this one) that bites us, but that's how things are.

Hope this helps.


Oh, also. Growl 1.1 will have sound playing built in on the application ticket.
Locked