From fa11792a11656d1af050b38004c0f9bd28478c77 Mon Sep 17 00:00:00 2001 From: Phillip Berndt Date: Fri, 16 Aug 2019 16:07:51 +0200 Subject: [PATCH] Don't fail hard in get_fb_dimensions if a mode isn't WWWxHHH See #159 --- autorandr.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autorandr.py b/autorandr.py index 0c1c942..cc1a25a 100755 --- a/autorandr.py +++ b/autorandr.py @@ -660,7 +660,10 @@ 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_mode = re.search("[0-9]{3,}x[0-9]{3,}", output.options["mode"]).group(0) + match = re.search("[0-9]{3,}x[0-9]{3,}", output.options["mode"]) + if not match: + return None + o_mode = match.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(",")) -- 2.39.2