mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-24 12:02:23 +00:00
Implemented get/set_primary
This commit is contained in:
parent
a66e69f5f6
commit
6bb15ea6d3
@ -54,6 +54,17 @@ class Screen:
|
||||
candidate = name
|
||||
return candidate
|
||||
|
||||
def get_primary(self):
|
||||
"""Return the primary monitor, if any."""
|
||||
for mon in self.monitors.values():
|
||||
if mon.primary:
|
||||
return mon
|
||||
return None
|
||||
|
||||
def set_primary(self, name):
|
||||
for mon in self.monitors.values():
|
||||
mon.primary = name == mon.output
|
||||
|
||||
|
||||
def read_data():
|
||||
data = subprocess.check_output(
|
||||
|
Loading…
Reference in New Issue
Block a user