X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=7edf72fb243d66404a094da3b02813942b704a78;hb=a64db8d1269af1c76bfa3604de489fe2f6c4a12e;hp=4187932632c1bb008c3d88cad62a31f1f1912611;hpb=3a1b5c484ea8a184a0ce6cdd61808d655e002746;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index 4187932..7edf72f 100755 --- a/autorandr.py +++ b/autorandr.py @@ -48,7 +48,7 @@ if sys.version_info.major == 2: else: import configparser -__version__ = "1.6" +__version__ = "1.7" try: input = raw_input @@ -317,7 +317,7 @@ class XrandrOutput(object): else: edid = "%s-%s" % (XrandrOutput.EDID_UNAVAILABLE, match["output"]) - if not match["width"]: + if not match["connected"]: options["off"] = None else: if match["mode_name"]: @@ -638,13 +638,17 @@ def get_fb_dimensions(configuration): if "off" in output.options or not output.edid: continue # This won't work with all modes -- but it's a best effort. - o_width, o_height = map(int, output.options["mode"].split("x")) + o_mode = re.search("[0-9]{3,}x[0-9]{3,}", output.options["mode"]).group(0) + o_width, o_height = map(int, o_mode.split("x")) if "transform" in output.options: a, b, c, d, e, f, g, h, i = map(float, output.options["transform"].split(",")) w = (g * o_width + h * o_height + i) x = (a * o_width + b * o_height + c) / w y = (d * o_width + e * o_height + f) / w o_width, o_height = x, y + if "rotate" in output.options: + if output.options["rotate"] in ("left", "right"): + o_width, o_height = o_height, o_width if "pos" in output.options: o_left, o_top = map(int, output.options["pos"].split("x")) o_width += o_left