Skip to content

Commit 2ab4426

Browse files
rb3ckersudifuchs
andauthored
Choose first embedded screen instead of first screen (#32)
Co-authored-by: Udi Fuchs <[email protected]>
1 parent d63379f commit 2ab4426

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

icc-brightness

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,18 @@ def find_profile(filename):
6868

6969

7070
def get_device_id():
71-
out = subprocess.check_output(['colormgr', 'get-devices-by-kind',
72-
'display'], env={'LANG':'C'})
73-
return get_object_path(out)
71+
device_id = None
72+
out = subprocess.check_output(
73+
['colormgr', 'get-devices-by-kind', 'display'], env={'LANG': 'C'}
74+
)
75+
for line in out.decode('utf8').split('\n'):
76+
if line.startswith('Object Path:'):
77+
device_id = line.split(':')[1].lstrip()
78+
elif line.startswith('Embedded:'):
79+
embedded = line.split(':')[1].lstrip()
80+
if embedded == "Yes":
81+
break
82+
return device_id
7483

7584

7685
last_icc_filename = None

0 commit comments

Comments
 (0)