mirror of
https://github.com/ralsina/xrandroll.git
synced 2025-07-26 18:55:43 +00:00
Implemented get/set_primary
This commit is contained in:
@@ -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(
|
||||||
|
Reference in New Issue
Block a user