Merge pull request #1525 from S0lll0s/hotfix

Fix bug in xrandr output detection
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2016-02-09 01:54:05 +03:00
commit b7ddafa410
1 changed files with 2 additions and 2 deletions

View File

@ -24,14 +24,14 @@ def get_i3_connection():
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):
'''Iterate over xrandr outputs
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(
run_cmd(pl, ['xrandr', '-q'])