mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-23 19:42:23 +00:00
Implemented choose_a_monitor
This commit is contained in:
parent
8159f07724
commit
76a836b82a
@ -38,6 +38,22 @@ class Screen:
|
||||
if a != b and is_replica_of(self.monitors[a], self.monitors[b]):
|
||||
self.monitors[a].replica_of.append(b)
|
||||
|
||||
def choose_a_monitor(self):
|
||||
"""Choose what monitor to select by default.
|
||||
|
||||
* Not disabled
|
||||
* Primary, if possible
|
||||
"""
|
||||
|
||||
candidate = None
|
||||
for name, mon in self.monitors.items():
|
||||
if not mon.enabled:
|
||||
continue
|
||||
if mon.primary:
|
||||
return name
|
||||
candidate = name
|
||||
return candidate
|
||||
|
||||
|
||||
def read_data():
|
||||
data = subprocess.check_output(
|
||||
|
Loading…
Reference in New Issue
Block a user