From 6ca4100bab895c6ea076904c60b0aed1534069d6 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Wed, 5 Feb 2020 19:57:47 -0300 Subject: [PATCH] parse w/h in mm --- xrandroll/monitor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xrandroll/monitor.py b/xrandroll/monitor.py index a8c23ff..7dba10a 100644 --- a/xrandroll/monitor.py +++ b/xrandroll/monitor.py @@ -64,6 +64,8 @@ class Monitor: primary = False orientation = "normal" item = None + w_in_mm = 100 + h_in_mm = 100 def __init__(self, data): """Initialize a monitor object out of data from xrandr --verbose. @@ -82,6 +84,7 @@ class Monitor: if self.enabled: self.pos_x, self.pos_y = parse.search("+{:d}+{:d}", self.header) self.res_x, self.res_y = parse.search("{:d}x{:d}", self.header) + self.w_in_mm, self.h_in_mm = parse.search("{:d}mm x {:d}mm", self.header) self.orientation = parse.search("{:w} (normal left inverted", self.header)[0] modes_data = _split_by_lines_matching("^ [^ ]", data)