mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-21 18:42:22 +00:00
Implemented get/set_primary
This commit is contained in:
parent
a66e69f5f6
commit
6bb15ea6d3
@ -54,6 +54,17 @@ class Screen:
|
|||||||
candidate = name
|
candidate = name
|
||||||
return candidate
|
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():
|
def read_data():
|
||||||
data = subprocess.check_output(
|
data = subprocess.check_output(
|
||||||
|
Loading…
Reference in New Issue
Block a user