aboutsummaryrefslogtreecommitdiffstats
path: root/src/x.py
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-02 11:18:18 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-02 11:18:18 +0200
commit3b2f42ddcc952bebfe1ac5b345865decf78ff3eb (patch)
tree5c37f6d9ea737969c2783c87f08f61c94bb97303 /src/x.py
parentupdate dist (diff)
downloadxpybar-3b2f42ddcc952bebfe1ac5b345865decf78ff3eb.tar.gz
xpybar-3b2f42ddcc952bebfe1ac5b345865decf78ff3eb.tar.bz2
xpybar-3b2f42ddcc952bebfe1ac5b345865decf78ff3eb.tar.xz
add support for outputs not being used1.10
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/x.py')
-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