mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-21 18:53:32 +00:00
freebsd update.. still needs work
This commit is contained in:
@@ -23,7 +23,7 @@ if (process.platform == 'linux' || process.platform == 'darwin')
|
|||||||
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
var child = require('child_process').execFile('/bin/sh', ['sh']);
|
||||||
child.stdout.str = '';
|
child.stdout.str = '';
|
||||||
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
|
child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
|
||||||
if (process.platform == 'linux')
|
if (process.platform == 'linux' || process.platform == 'freebsd')
|
||||||
{
|
{
|
||||||
child.stdin.write("whereis " + app + " | awk '{ print $2 }'\nexit\n");
|
child.stdin.write("whereis " + app + " | awk '{ print $2 }'\nexit\n");
|
||||||
}
|
}
|
||||||
@@ -100,12 +100,14 @@ function Toaster()
|
|||||||
return (retVal);
|
return (retVal);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'freebsd':
|
||||||
case 'linux':
|
case 'linux':
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
retVal.consoleUid = require('user-sessions').consoleUid();
|
retVal.consoleUid = require('user-sessions').consoleUid();
|
||||||
retVal.xinfo = require('monitor-info').getXInfo(retVal.consoleUid);
|
retVal.xinfo = require('monitor-info').getXInfo(retVal.consoleUid);
|
||||||
|
retVal.username = require('user-sessions').getUsername(retVal.consoleUid);
|
||||||
}
|
}
|
||||||
catch (xxe)
|
catch (xxe)
|
||||||
{
|
{
|
||||||
@@ -174,14 +176,20 @@ function Toaster()
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
util = findPath('kdialog');
|
util = findPath('kdialog');
|
||||||
if (util) {
|
if (util)
|
||||||
|
{
|
||||||
// use KDIALOG
|
// use KDIALOG
|
||||||
var xdg = require('user-sessions').findEnv(retVal.consoleUid, 'XDG_RUNTIME_DIR');
|
var xdg = require('user-sessions').findEnv(retVal.consoleUid, 'XDG_RUNTIME_DIR');
|
||||||
if (!retVal.xinfo || !retVal.xinfo.display || !retVal.xinfo.xauthority || !xdg)
|
if(xdg==null)
|
||||||
|
{
|
||||||
|
xdg = '/tmp/runtime-' + retVal.username;
|
||||||
|
}
|
||||||
|
if (!retVal.xinfo || !retVal.xinfo.display || !retVal.xinfo.xauthority)
|
||||||
{
|
{
|
||||||
retVal._rej('Internal Error');
|
retVal._rej('Internal Error');
|
||||||
return (retVal);
|
return (retVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
retVal._notify = require('child_process').execFile(util, ['kdialog', '--title', retVal.title, '--passivepopup', retVal.caption, '5'], { uid: retVal.consoleUid, env: { DISPLAY: retVal.xinfo.display, XAUTHORITY: retVal.xinfo.xauthority, XDG_RUNTIME_DIR: xdg } });
|
retVal._notify = require('child_process').execFile(util, ['kdialog', '--title', retVal.title, '--passivepopup', retVal.caption, '5'], { uid: retVal.consoleUid, env: { DISPLAY: retVal.xinfo.display, XAUTHORITY: retVal.xinfo.xauthority, XDG_RUNTIME_DIR: xdg } });
|
||||||
retVal._notify.parent = retVal;
|
retVal._notify.parent = retVal;
|
||||||
retVal._notify.stdout.on('data', function (chunk) { });
|
retVal._notify.stdout.on('data', function (chunk) { });
|
||||||
|
|||||||
Reference in New Issue
Block a user