mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-24 12:02:23 +00:00
parse w/h in mm
This commit is contained in:
parent
172b943f26
commit
6ca4100bab
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user