Without this change, icc-brightness takes the first monitor returned by colormgr get-devices-by-kind display. This works fine for single monitor setups however this isn't guaranteed to be the laptop's embedded monitor.
This change enhances the get_device_id() logic to not just look at the "Object Path:" output lines for monitor identifies but also the "Embedded:" lines. External monitors should show as "Embedded: No" whereas the laptop's monitor should show as "Embedded: Yes". With this extra check, icc-brightness can operate over the first embedded monitor regardless whether it is a primary or secondary monitor and the order of colormgr output.
Testing done:
I have a Dell XPS 15 7590 with 4K OLED display running on Ubuntu 20.04. icc-brightness only operates over my laptop's embedded monitor in a single monitor setup and when connected to two external monitors via my Dell WD19TB dock.
Known issues/limitations:
The brightness seems to reset to full when unplugging/plugging in the thunderbolt connector or after going from clamshell->open on the laptop. A single brightness change will make it jump down to the setting it should be at.
Is there a use case for non-embedded OLED displays? If so we may need to be smarter again.
Summary of issue:
Without this change, icc-brightness takes the first monitor returned by
colormgr get-devices-by-kind display
. This works fine for single monitor setups however this isn't guaranteed to be the laptop's embedded monitor.This change enhances the get_device_id() logic to not just look at the "Object Path:" output lines for monitor identifies but also the "Embedded:" lines. External monitors should show as "Embedded: No" whereas the laptop's monitor should show as "Embedded: Yes". With this extra check, icc-brightness can operate over the first embedded monitor regardless whether it is a primary or secondary monitor and the order of colormgr output.
Testing done:
I have a Dell XPS 15 7590 with 4K OLED display running on Ubuntu 20.04. icc-brightness only operates over my laptop's embedded monitor in a single monitor setup and when connected to two external monitors via my Dell WD19TB dock.
Known issues/limitations:
(Somewhat) Related Issues: https://github.com/udifuchs/icc-brightness/issues/12 https://github.com/udifuchs/icc-brightness/issues/21