X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=autorandr.py;h=69125d1abc3008d523314ef37f15fbe1e09ffb06;hb=68d0d423f700a29db97dee710ebd72fb6b2cff8b;hp=526a753f15d524f51e45a3b1918c37a562486a2d;hpb=c24425d941f8a7c6a254afcb49769558dc41d698;p=deb_pkgs%2Fautorandr.git diff --git a/autorandr.py b/autorandr.py index 526a753..69125d1 100755 --- a/autorandr.py +++ b/autorandr.py @@ -87,14 +87,17 @@ class XrandrOutput(object): ) \s* (?Pprimary\ )? # Might be primary screen - (?:\s* # The remainder of the first line only appears as one or not at all: + (?:\s* (?P[0-9]+)x(?P[0-9]+) # Resolution (might be overridden below!) - \+(?P[0-9]+)\+(?P[0-9]+)\s+ # Position + \+(?P-?[0-9]+)\+(?P-?[0-9]+)\s+ # Position (?:\(0x[0-9a-fA-F]+\)\s+)? # XID (?P(?:normal|left|right|inverted))\s+ # Rotation (?:(?PX\ and\ Y|X|Y)\ axis)? # Reflection )? # .. but everything of the above only if the screen is in use. - (?:[\ \t]*\(.+)? + (?:[\ \t]*\([^\)]+\))(?:\s*[0-9]+mm\sx\s[0-9]+mm)? + (?:[\ \t]*panning\ (?P[0-9]+x[0-9]+\+[0-9]+\+[0-9]+))? # Panning information + (?:[\ \t]*tracking\ (?P[0-9]+x[0-9]+\+[0-9]+\+[0-9]+))? # Tracking information + (?:[\ \t]*border\ (?P(?:[0-9]+/){3}[0-9]+))? # Border information (?:\s*(?: # Properties of the output Gamma: (?P[0-9\.: ]+) | # Gamma value Transform: (?P(?:[\-0-9\. ]+\s+){3}) | # Transformation matrix @@ -103,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 )*) """ @@ -118,6 +121,7 @@ class XrandrOutput(object): XRANDR_13_DEFAULTS = { "transform": "1,0,0,0,1,0,0,0,1", + "panning": "0x0", } XRANDR_12_DEFAULTS = { @@ -238,6 +242,13 @@ class XrandrOutput(object): elif match["reflect"] == "X and Y": options["reflect"] = "xy" options["pos"] = "%sx%s" % (match["x"], match["y"]) + if match["panning"]: + panning = [ match["panning"] ] + if match["tracking"]: + panning += [ "/", match["tracking"] ] + if match["border"]: + panning += [ "/", match["border"] ] + options["panning"] = "".join(panning) if match["transform"]: transformation = ",".join(match["transform"].strip().split()) if transformation != "1.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,0.000000,1.000000":