Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

prevent notifications from piling up in Gnome #25

Merged
merged 1 commit into from

4 participants

@fgnass

No description provided.

@tj tj merged commit 488e9bf into from
@alfredwesterveld

String thing in Fedora (Gnome shell) this only works if image attribute is also set.

var notify = require('growl')
notify('a', { name: 'a', title:' b', image: 'c'})

=> Okay

var notify = require('growl')
notify('a', { name: 'a', title:' b')

Fail? Why?

@technobly

This is not proper JS Object Notation (JSON) http://www.json.org/

var notify = require('growl')
notify('a', { name: 'a', title:' b' )

You need a closing bracket:

var notify = require('growl')
notify('a', { name: 'a', title:' b' } )
@alfredwesterveld

@DubbyTT Oops forgot that bracket. I am using that bracket. I am seeing a notification but it will not dissappear from system tray unless I add property image

@technobly

@alfredwesterveld when you use the 'image' tag you need a path to your image. Grab this test image and follow my example: http://d.pr/i/2beH Put this in the same folder with your test script and name it test.png If you use a different image make it 48px x 48px or it will be resized by Growl.

// test.js
var growl = require('./lib/growl');
growl('message', { name: 'app name', title: 'message title', image: './test.png' } );

Run as node test.js

Produces the following notification:
http://i.imgur.com/e4Sxsxw.png

Here is where you can adjust the default duration of your notification:
http://i.imgur.com/u8Rdi0Y.png (note that it will hang out forever if you hover over it after it pops up)

BTW: I've made this modification to my growl library to automatically register new applications on windows:
#30
itsjamie@e38a3f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 22, 2012
  1. @fgnass
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  lib/growl.js
View
2  lib/growl.js
@@ -165,6 +165,8 @@ function growl(msg, options, fn) {
break;
case 'Linux':
args.push(cmd.icon + " " + image);
+ // libnotify defaults to sticky, set a hint for transient notifications
+ if (!options.sticky) args.push('--hint=int:transient:1');
break;
case 'Windows':
args.push(cmd.icon + quote(image));
Something went wrong with that request. Please try again.