Skip to content
This repository

Add support for priority. #5

Merged
merged 1 commit into from almost 3 years ago

2 participants

Stein Martin Hustad TJ Holowaychuk
Stein Martin Hustad
smh commented

growlnotify has support for setting the priority of the notification. This adds an option for setting this priority.

TJ Holowaychuk visionmedia merged commit b811ea5 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Oct 06, 2011
Stein Martin Hustad smh Add support for priority. a78cace
This page is out of date. Refresh to see the latest.

Showing 3 changed files with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. +3 0  Readme.md
  2. +2 0  lib/growl.js
  3. +1 0  test.js
3  Readme.md
Source Rendered
@@ -16,6 +16,7 @@ Callback functions are optional
16 16 growl.notify('You have mail!')
17 17 growl.notify('5 new messages', { sticky: true })
18 18 growl.notify('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })
  19 + growl.notify('Set priority', { priority: 2 })
19 20 growl.notify('Show Safari icon', { image: 'Safari' })
20 21 growl.notify('Show icon', { image: 'path/to/icon.icns' })
21 22 growl.notify('Show image', { image: 'path/to/my.image.png' })
@@ -31,6 +32,8 @@ Callback functions are optional
31 32 - notification title
32 33 - name
33 34 - application name
  35 + - priority
  36 + - priority for the notification (default is 0)
34 37 - sticky
35 38 - weither or not the notification should remainin until closed
36 39 - image
2  lib/growl.js
@@ -36,6 +36,7 @@ exports.binVersion = function(fn) {
36 36 *
37 37 * - title Notification title
38 38 * - sticky Make the notification stick (defaults to false)
  39 + * - priority Specify an int or named key (default is 0)
39 40 * - name Application name (defaults to growlnotify)
40 41 * - image
41 42 * - path to an icon sets --iconpath
@@ -75,6 +76,7 @@ exports.notify = function(msg, options, fn) {
75 76 args.push('--' + flag, image)
76 77 }
77 78 if (options.sticky) args.push('--sticky');
  79 + if (options.priority) args.push('--priority', options.priority);
78 80 if (options.name) args.push('--name', options.name);
79 81 if (options.title) args.push(options.title);
80 82 exec(args.join(' '), fn);
1  test.js
@@ -7,6 +7,7 @@ growl.binVersion(function(err, version){
7 7 growl.notify('You have mail!')
8 8 growl.notify('5 new messages', { sticky: true })
9 9 growl.notify('5 new emails', { title: 'Email Client', image: 'Safari', sticky: true })
  10 +growl.notify('Set priority', { priority: 2 })
10 11 growl.notify('Show Safari icon', { image: 'Safari' })
11 12 growl.notify('Show icon', { image: 'path/to/icon.icns' })
12 13 growl.notify('Show image', { image: 'path/to/my.image.png' })

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.