mirror of
https://github.com/Ylianst/MeshAgent
synced 2026-01-04 01:23:21 +00:00
updated getXInfo, so returns only DISPLAY if XAUTHORITY is not found
This commit is contained in:
@@ -356,6 +356,23 @@ function monitorinfo()
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ret == null)
|
||||
{
|
||||
// We couldn't find XAUTHORITY and DISPLAY, so as a last ditch effort, lets just look for DISPLAY
|
||||
for (var n in lines)
|
||||
{
|
||||
var ln = lines[n].trim();
|
||||
if (ln.length > 0)
|
||||
{
|
||||
var e = require('user-sessions').getEnvFromPid(ln);
|
||||
if (e.DISPLAY)
|
||||
{
|
||||
ret = { tty: '?', display: e.DISPLAY };
|
||||
return (ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user