udifuchs / icc-brightness

Control OLED display brightness by applying ICC color profiles.
MIT License
170 stars 25 forks source link

icc-brightness: get_device_id returns first device that is listed as embedded #30

Closed jessr92 closed 4 years ago

jessr92 commented 4 years ago

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:

  1. 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.
  2. Is there a use case for non-embedded OLED displays? If so we may need to be smarter again.

(Somewhat) Related Issues: https://github.com/udifuchs/icc-brightness/issues/12 https://github.com/udifuchs/icc-brightness/issues/21