aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/x.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/x.py b/src/x.py
index 300bb06..471913b 100644
--- a/src/x.py
+++ b/src/x.py
@@ -68,15 +68,18 @@ def get_monitors():
s = int(line[len('Screen '):].split(':')[0])
elif s == screen_i:
if ' connected ' in line:
- m = line.replace('-', '+-').replace('++', '+')
- p = ' primary ' in m
- m = m.replace(' primary ', ' ')
- m = m.split(' ')[2].replace('+', 'x').split('x')
- m = [int(x) for x in m]
- if p and (prim is None):
- prim = m
- else:
- rc.append(m)
+ try:
+ m = line.replace('-', '+-').replace('++', '+')
+ p = ' primary ' in m
+ m = m.replace(' primary ', ' ')
+ m = m.split(' ')[2].replace('+', 'x').split('x')
+ m = [int(x) for x in m]
+ if p and (prim is None):
+ prim = m
+ else:
+ rc.append(m)
+ except:
+ pass # Output not used
if prim is not None:
rc = [prim] + rc
return rc