From c1c074ab894f517d4f5194de3359c213e50fb9f0 Mon Sep 17 00:00:00 2001 From: Luke Arms Date: Thu, 1 Jul 2021 14:34:56 +1000 Subject: [PATCH] Match whitespace explicitly in property name Also: - Include additional properties --- autorandr.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autorandr.py b/autorandr.py index c1bdd19..f47a994 100755 --- a/autorandr.py +++ b/autorandr.py @@ -71,6 +71,11 @@ properties = [ "Broadcast RGB", "audio", "non-desktop", + "TearFree", + "underscan vborder", + "underscan hborder", + "underscan", + "scaling mode", ] help_text = """ @@ -161,7 +166,7 @@ class XrandrOutput(object): XRANDR_PROPERTIES_REGEXP = "|".join( [r"{}:\s*(?P<{}>[\S ]*\S+)" - .format(p, re.sub(r"\W+", "_", p.lower())) + .format(re.sub(r"\s", r"\\\g<0>", p), re.sub(r"\W+", "_", p.lower())) for p in properties]) # This regular expression is used to parse an output in `xrandr --verbose' -- 2.39.2