Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address monitors by edid.name or edid.serial instead of display number #85

Open
christophberger opened this issue Nov 3, 2020 · 3 comments

Comments

@christophberger
Copy link

Hi,

First of all, this project is awesome and saves me a lot of daily hassle. I use two different external monitors on a Macbook, and one of them cannot remember its brightness. ddcctl, together with some automation, reminds the monitor to brighten up :)

However, every once in a while, when the Mac wakes up, it flips the display numbers. The monitor that used to be no. 1 is now no. 2 and vice versa. When this happens, any script of the form ddcctl -d <number> accesses the wrong monitor.

So it would be great if ddcctl gets an option for addressing monitors by their edid.name or edid.serial value, rather than their (volatile) display number.

Examples:
ddcctl -d 9X2VY5C410UL (passing edid.serial)
ddcctl -d "DELL U2515H" (passing edid.name)

I haven't touched ObjC or Apple libraries/API's since a decade or so, hence I am not in the best position to contribute a PR, but maybe someone else can?

@christophberger
Copy link
Author

christophberger commented Nov 4, 2020

Workaround found:

Sample function for the Fish shell:

function bright
    set monitor (ddcctl -d 1 -b '?' | awk 'BEGIN{ FS=": "} /edid.name/{ print $3 }')
    if test $monitor = "IPS1506UHDR"
        set display 1
    else
        set display 2
    end
    ddcctl -d $display -b 38 
end

Would be awesome to have sth like ddcctl -d "IPS1506UHDR" -b 38 as a solution

@kfix
Copy link
Owner

kfix commented Nov 26, 2020

there's a couple of PRs I want to get merged first, but we could support a string expression.

You seem to be lucky in that your Dell has a serial number, but who knows how unique that really is with another Dell of the same model.

there's also some chatter about how we could grab a persistent GUID for a particular display: https://stackoverflow.com/a/48450870.

If that really holds up across reboots and incorporates Model-Vendor-Serial, using those UUID's might be the way to go.

@christophberger
Copy link
Author

I have only one Dell, the other display is a different brand, so for me there is no risk of identical serial numbers. But I see the point.
Let's hope the persistent GUID's have all properties required to solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants