X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=c33246f4ddb9c7b0a2052dc645299a36fe9976a7;hb=89bf1ac166e2c124c2b0bd687138b8fddbe74c47;hp=aa464d61090774470ddef778b58e475f7b13ed74;hpb=1a37be02ae147c492e0e5f91b0f4537d888c6414;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index aa464d6..c33246f 100755 --- a/autorandr.py +++ b/autorandr.py @@ -106,9 +106,9 @@ class XrandrOutput(object): ))+ \s* (?P(?: - (?P[0-9]+)x(?P[0-9]+).+?\*current.+\s+ + (?P[0-9]+)x(?P[0-9]+).+?\*current.*\s+ h:.+\s+v:.+clock\s+(?P[0-9\.]+)Hz\s* | # Interesting (current) resolution: Extract rate - [0-9]+x[0-9]+.+\s+h:.+\s+v:.+\s* # Other resolutions + [0-9]+x[0-9]+(?:(?!\*current).)+\s+h:.+\s+v:.+\s* # Other resolutions )*) """ @@ -206,7 +206,7 @@ class XrandrOutput(object): remainder = xrandr_output[len(match_object.group(0)):] if remainder: raise RuntimeError(("Parsing XRandR output failed, %d bytes left unmatched after regular expression, " - "starting at byte %d with ..'%s'.") % (len(remainder), len(len(match_object.group(0))), remainder[:10])) + "starting at byte %d with ..'%s'.") % (len(remainder), len(match_object.group(0)), remainder[:10])) match = match_object.groupdict() @@ -256,7 +256,7 @@ class XrandrOutput(object): if not match["mode_width"]: # TODO We'd need to apply the reverse transformation here. Let's see if someone complains, I doubt that this # special case is actually required. - print("Warning: Output %s has a transformation applied. Could not determine correct mode!", file=sys.stderr) + print("Warning: Output %s has a transformation applied. Could not determine correct mode! Using `%s'." % (match["output"], options["mode"]), file=sys.stderr) if match["gamma"]: gamma = match["gamma"].strip() options["gamma"] = gamma