1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-21 18:53:32 +00:00
This commit is contained in:
Bryan Roe
2019-06-24 16:05:00 -07:00
parent a665f77155
commit f629d47896
2 changed files with 7 additions and 7 deletions

View File

@@ -192,14 +192,14 @@ function linux_messageBox()
kdialog = child.stdout.str.trim();
if (process.platform == 'freebsd' && kdialog == '' && require('fs').existsSync('/usr/local/bin/kdialog')) { kdialog = '/usr/local/bin/kdialog'; }
if (kdialog == '') { ret._rej('Platform not supported (zenity or kdialog not found)'); return (ret); }
if (process.env['DISPLAY'])
if (process.platform != 'freebsd' && process.env['DISPLAY'])
{
ret.child = require('child_process').execFile(kdialog, ['kdialog', '--title', title, '--yesno', caption]);
ret.child.promise = ret;
}
else
{
var xdg = require('user-sessions').findEnv(uid, 'XDG_RUNTIME_DIR');
var xdg = require('user-sessions').findEnv(uid, 'XDG_RUNTIME_DIR'); if (xdg == null) { xdg = ''; }
if (!xinfo || !xinfo.display || !xinfo.xauthority) { ret._rej('Interal Error, could not determine X11/XDG env'); return (ret); }
ret.child = require('child_process').execFile(kdialog, ['kdialog', '--title', title, '--yesno', caption], { uid: uid, env: { DISPLAY: xinfo.display, XAUTHORITY: xinfo.xauthority, XDG_RUNTIME_DIR: xdg } });
ret.child.promise = ret;