1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-03 09:03:48 +00:00

Fixed xauthority parsing issue on some window managers

This commit is contained in:
Bryan Roe
2022-04-02 20:45:45 -07:00
parent 426bd345d4
commit 2fc1af473a
2 changed files with 3 additions and 2 deletions

View File

@@ -572,7 +572,7 @@ function monitorinfo()
child.stdin.write(' {');
child.stdin.write(' display=$4;');
child.stdin.write(' }');
child.stdin.write(' match($0, /-auth .+ +/);');
child.stdin.write(' match($0, /-auth .+/);');
child.stdin.write(' split(substr($0,RSTART+6,RLENGTH-6), _authtok, " ");');
child.stdin.write(' _auth = _authtok[1];');
//child.stdin.write(' _auth = substr($0,RSTART+6,RLENGTH-6);');
@@ -659,6 +659,7 @@ function monitorinfo()
ret = { tty: '?', xauthority: (require('user-sessions').getHomeFolder(consoleuid) + '/.Xauthority').split('//').join('/'), display: child.stdout.str.trim(), exportEnv: exportEnv };
if (!require('fs').existsSync(ret.xauthority))
{
console.info1(ret.xauthority + ' => DOES NOT EXIST');
child = require('child_process').execFile('/bin/sh', ['sh']);
child.stdout.str = ''; child.stdout.on('data', function (chunk) { this.str += chunk.toString(); });
child.stderr.str = ''; child.stderr.on('data', function (chunk) { this.str += chunk.toString(); });