From f4f0a37522ba845e43c9ec4b756158a3f2e68351 Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Fri, 17 May 2019 16:09:47 -0700 Subject: [PATCH] updated getXInfo, so returns only DISPLAY if XAUTHORITY is not found --- modules/monitor-info.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/monitor-info.js b/modules/monitor-info.js index d673117..62fc2a9 100644 --- a/modules/monitor-info.js +++ b/modules/monitor-info.js @@ -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 {