Fix output detection when setting primary outputs

in powerline.bindings.wm.get_connected_xrandr_outputs
This commit is contained in:
S0lll0s 2016-02-08 22:09:30 +01:00
parent 6d7f242e1b
commit 953a55f789
1 changed files with 2 additions and 2 deletions

View File

@ -24,14 +24,14 @@ def get_i3_connection():
return conn return conn
XRANDR_OUTPUT_RE = re.compile(r'^(?P<name>[0-9A-Za-z-]+) connected (?P<width>\d+)x(?P<height>\d+)\+(?P<x>\d+)\+(?P<y>\d+)', re.MULTILINE) XRANDR_OUTPUT_RE = re.compile(r'^(?P<name>[0-9A-Za-z-]+) connected(?P<primary> primary)? (?P<width>\d+)x(?P<height>\d+)\+(?P<x>\d+)\+(?P<y>\d+)', re.MULTILINE)
def get_connected_xrandr_outputs(pl): def get_connected_xrandr_outputs(pl):
'''Iterate over xrandr outputs '''Iterate over xrandr outputs
Outputs are represented by a dictionary with ``name``, ``width``, Outputs are represented by a dictionary with ``name``, ``width``,
``height``, ``x`` and ``y`` keys. ``height``, ``primary``, ``x`` and ``y`` keys.
''' '''
return (match.groupdict() for match in XRANDR_OUTPUT_RE.finditer( return (match.groupdict() for match in XRANDR_OUTPUT_RE.finditer(
run_cmd(pl, ['xrandr', '-q']) run_cmd(pl, ['xrandr', '-q'])