diff --git a/lib/growl.js b/lib/growl.js index 4636927..c38d3c1 100644 --- a/lib/growl.js +++ b/lib/growl.js @@ -86,7 +86,7 @@ function setupCmd() { type: 'Linux', pkg: 'notify-send', msg: '', - sticky: '-t 0', + sticky: '-t', icon: '-i', priority: { cmd: '-u', @@ -214,6 +214,7 @@ function growl(msg, opts, callback) { // sticky if (options.sticky) args.push(cmd.sticky); + if (options.sticky && cmd.type === 'Linux') args.push('0'); // priority if (options.priority) { @@ -272,13 +273,8 @@ function growl(msg, opts, callback) { } break; case 'Linux': - if (options.title) { - args.push(options.title); - args.push(cmd.msg); - args.push(msg.replace(/\\n/g, '\n')); - } else { - args.push(msg.replace(/\\n/g, '\n')); - } + if (options.title) args.push(options.title); + args.push(msg.replace(/\\n/g, '\n')); break; case 'Windows': args.push(msg.replace(/\\n/g, '\n')); @@ -312,6 +308,11 @@ function growl(msg, opts, callback) { let stderr = ''; let error; + const now = new Date(); + const timestamp = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()}.${now.getMilliseconds()}` + + stderr += `[${timestamp}][node-growl] : Executed command '${cmdToExec}' with arguments '${args}'\n[stderr] : `; + child.on('error', (err) => { console.error('An error occured.', err); error = err;