primary monitor parsing

This commit is contained in:
Roberto Alsina 2020-02-05 18:35:54 -03:00
parent a409fcaa69
commit 8159f07724

View File

@ -61,6 +61,7 @@ class Monitor:
pos_x = 0 pos_x = 0
pos_y = 0 pos_y = 0
enabled = False enabled = False
primary = False
def __init__(self, data): def __init__(self, data):
"""Initialize a monitor object out of data from xrandr --verbose. """Initialize a monitor object out of data from xrandr --verbose.
@ -70,6 +71,7 @@ class Monitor:
self.header = data.pop(0) self.header = data.pop(0)
self.output = parse.search("{}{:s}", self.header)[0] self.output = parse.search("{}{:s}", self.header)[0]
self.primary = "primary" in self.header
self.replica_of = [] self.replica_of = []
if "disconnected" in self.header: if "disconnected" in self.header:
# No modes, no pos, no fields, no nothing. # No modes, no pos, no fields, no nothing.