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

Add di option #123

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add di option #123

wants to merge 2 commits into from

Conversation

hcebke
Copy link

@hcebke hcebke commented Mar 14, 2022

Add the option -di to allow specifying the display by its ID instead of its (arbitrary, non-permanent) list index.

So far, -d was the only way to specify which display to send commands to. This refers to the list index of the display. Unfortunately, sometimes, depending on extraneous factors such as the order in which displays were plugged in, the order of the list changes. In order to reliably specify the same display every time, I added the -di option that allows the user to specify the displayID as shown by ddcctl. At least on my setup, this ID remains constant.

To test this feature, run ddcctl once to see the available displayID values on your system. Pick one, run ddcctl -di <DISPLAY_ID>. It acts the same as if you did ddcctl -d <POSITION_OF_DISPLAY_IN_LIST>.

This fix might also be a viable workaround for #85.

@CelsoSantos
Copy link

@hcebke any chance you could look into this please? Can it be merged or not really?

Copy link
Owner

@kfix kfix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for the delay, life is busy.

just one nit, otherwise looks fine

if (displayUid != NULL) {
char *endptr;
uint uid = strtol(displayUid, &endptr, 10);
if (endptr == displayUid) {
Copy link
Owner

@kfix kfix Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather should be checking that uid == 0.

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

Successfully merging this pull request may close these issues.

None yet

3 participants