diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-04-02 11:18:18 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-04-02 11:18:18 +0200 |
commit | 3b2f42ddcc952bebfe1ac5b345865decf78ff3eb (patch) | |
tree | 5c37f6d9ea737969c2783c87f08f61c94bb97303 /src | |
parent | update dist (diff) | |
download | xpybar-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 '')
-rw-r--r-- | src/x.py | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -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 |