mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-15 07:43:50 +00:00
Fixed error case for linux notifications, by checking zenity version, to do fallback for notify-send, if it exists, otherwise using zenity --info, with a faked timeout if necessary.
This commit is contained in:
@@ -171,6 +171,20 @@ function linux_messageBox()
|
||||
})()
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Object.defineProperty(this, 'notifysend',
|
||||
{
|
||||
value: (function ()
|
||||
{
|
||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||
child.stdout.str = ''; child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
|
||||
child.stdin.write("whereis notify-send | awk '{ print $2 }'\nexit\n");
|
||||
child.waitExit();
|
||||
return (child.stdout.str.trim() == '' ? null : { path: child.stdout.str.trim() });
|
||||
})()
|
||||
});
|
||||
}
|
||||
|
||||
this.create = function create(title, caption, timeout)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user