mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-24 03:52:22 +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]):
|
if a != b and is_replica_of(self.monitors[a], self.monitors[b]):
|
||||||
self.monitors[a].replica_of.append(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():
|
def read_data():
|
||||||
data = subprocess.check_output(
|
data = subprocess.check_output(
|
||||||
|
Loading…
Reference in New Issue
Block a user