changeset 1001:3184772368a5

update Xorg process finder Ignore-this: 87d41a43e26e39dc7c6b2d96949167ba darcs-hash:20151004111427-312f9-ce4d83d21bf33a5f209ac55bd5da4856e2b6e3cb
author drewp <drewp@bigasterisk.com>
date Sun, 04 Oct 2015 04:14:27 -0700
parents df5a40967a2f
children a94e05a79d4e
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