Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const notifySendFlags = {
c: 'category',
category: 'category',
subtitle: 'category',
action: 'action',
h: 'hint',
hint: 'hint',
a: 'app-name',
Expand All @@ -56,14 +57,13 @@ module.exports.command = function (notifier, options, cb) {
console.info('[notifier options]', options.join(' '));
}

return cp.exec(notifier + ' ' + options.join(' '), function (
error,
stdout,
stderr
) {
if (error) return cb(error);
cb(stderr, stdout);
});
return cp.exec(
notifier + ' ' + options.join(' '),
function (error, stdout, stderr) {
if (error) return cb(error);
cb(stderr, stdout);
}
);
};

module.exports.fileCommand = function (notifier, options, cb) {
Expand Down
12 changes: 10 additions & 2 deletions notifiers/notifysend.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,21 @@ function notifyRaw(options, callback) {
}

Object.defineProperty(NotifySend.prototype, 'notify', {
get: function() {
get: function () {
if (!this._notify) this._notify = notifyRaw.bind(this);
return this._notify;
}
});

const allowedArguments = ['urgency', 'expire-time', 'icon', 'category', 'hint', 'app-name'];
const allowedArguments = [
'urgency',
'expire-time',
'icon',
'category',
'hint',
'app-name',
'action'
];

function doNotification(options, callback) {
options = utils.mapToNotifySend(options);
Expand Down
3 changes: 3 additions & 0 deletions test/notify-send.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ describe('notify-send', function () {
'"body"',
'--icon',
'"icon-string"',
'--action',
'"action_type"',
'--expire-time',
'"1000"'
];
Expand All @@ -127,6 +129,7 @@ describe('notify-send', function () {
message: 'body',
icon: 'icon-string',
time: 1,
action: 'action_type',
tullball: 'notValid'
});
});
Expand Down