Skip to content

Commit f1cd3d6

Browse files
committed
feat: add support for -d duration parameter in ntfytoast
1 parent 0d02978 commit f1cd3d6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

lib/utils.js

+15
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ module.exports.mapToWin8 = function (options) {
399399
} else {
400400
options.p = options.icon;
401401
}
402+
402403
delete options.icon;
403404
}
404405

@@ -438,6 +439,20 @@ module.exports.mapToWin8 = function (options) {
438439
delete options.wait;
439440
}
440441

442+
/*
443+
-d (duration) flag for ntfytoast
444+
must be one of two options:
445+
-d short | long
446+
*/
447+
448+
if (options.timeout) {
449+
if (options.timeout === 'long' || (typeof options.timeout === 'number' && options.timeout > 7)) {
450+
options.d = 'long';
451+
} else {
452+
options.d = 'short';
453+
}
454+
}
455+
441456
if (options.s === false) {
442457
options.silent = true;
443458
delete options.s;

0 commit comments

Comments
 (0)