changeset 196:2f8ba398f958

update Xorg process finder Ignore-this: 87d41a43e26e39dc7c6b2d96949167ba
author drewp@bigasterisk.com
date Sun, 04 Oct 2015 04:14:27 -0700
parents 9ce1214e4534
children 72a003e721f9
files lib/localdisplay.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lib/localdisplay.py	Sun Aug 30 11:53:25 2015 -0700
+++ b/lib/localdisplay.py	Sun Oct 04 04:14:27 2015 -0700
@@ -10,11 +10,13 @@
     for pid in psutil.get_pid_list():
         try:
             proc = psutil.Process(pid)
-            if proc.exe not in ['/usr/bin/Xorg', '/usr/bin/X']:
+            if proc.exe not in ['/usr/bin/Xorg', '/usr/bin/X', '/usr/bin/X11/X']:
                 continue
         except (psutil.error.AccessDenied, psutil.error.NoSuchProcess):
             continue
-        display = proc.cmdline[1]
+        display = [arg for arg in proc.cmdline if not arg.startswith('-')][1]
+        if display == 'tcp': # ??
+            display = ":0.0"
         assert display.startswith(':'), display
         os.environ['DISPLAY'] = display
         break