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

Check for connected displays #1

Open
KeyofBlueS opened this issue Apr 9, 2021 · 0 comments
Open

Check for connected displays #1

KeyofBlueS opened this issue Apr 9, 2021 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@KeyofBlueS
Copy link
Owner

KeyofBlueS commented Apr 9, 2021

Applying a profile that contains one or more displays that are not connected can lead to a misconfiguration.
From what I see in xfconf, the only value I could use in order to match configured displays with connected displays should be EDID value.
We need a way, in bash, to retrieve that value in the same format, as it isn't the same of what we can get with e.g. xrandr --prop.

example:
We want to e.g. set profile d6c313ffc53db7cfeee6fa40538985c5eefb24cc. This profile has two configured EDID:

$ xfconf-query -v -l -c displays -p /d6c313ffc53db7cfeee6fa40538985c5eefb24cc | grep '/EDID '
/d6c313ffc53db7cfeee6fa40538985c5eefb24cc/DVI-I-1/EDID        d57a084978bbd241c62509aea3ab64a427ffc73e
/d6c313ffc53db7cfeee6fa40538985c5eefb24cc/HDMI-0/EDID         471766147bfc30d2842655fadc76e95ca11d595b

Now we want to be sure those two EDIDs to be connected before set the profile.
So the question is, how?
With xrandr --prop we can get the connected EDIDs:

...
DVI-I-1 connected
...
	EDID: 
		00ffffffffffff0041622101b12a3000
		0314010380341d78eaeed5a555489b26
		125054b30c00714f8180810095000101
		010101010101023a801871382d40582c
		450009252100001e000000fc00566973
		656f2032343044580a20000000fd0038
		4c1f5312000a202020202020000000ff
		004432343043303032343030310a00e4
...
HDMI-0 connected
...
	EDID: 
		00ffffffffffff001e6d010001010101
		011e010380a05a780aee91a3544c9926
		0f5054a1080031404540614071408180
		d1c00101010108e80030f2705a80b058
		8a0040846300001e662150b051001b30
		4070360040846300001e000000fd0018
		781e873c000a202020202020000000fc
		004c4720545620535343520a202001e4
		02034ff15a6160101f66650413051403
		021220212215015d5e5f6263643f4029
		0957071507505507006e030c001000b8
		3c2400800102030468d85dc401788003
		02e200cfe305c000e3060d01e20f3356
		5e00a0a0a02950302035004084630000
		1e000000000000000000000000000000
		000000000000000000000000000000f3
...

but they are not in the same format as those seen in xfconf-query, so we need:
CONNECTED_EDIDS="$(some command to get current connected displays EDID the same way as seen in xconf-query)"

I've been pointed to https://gitlab.xfce.org/xfce/xfce4-settings/-/blob/master/common/edid-parse.c

Any help is greatly appreciated.

IN ANY CASE a part from EDID, various checks are performed to assure a profile can be applied in first place, so this script could be considered reliable, especially if your displays are always the same.

@KeyofBlueS KeyofBlueS added the help wanted Extra attention is needed label Apr 9, 2021
KeyofBlueS added a commit that referenced this issue Jan 10, 2022
- check if the active profile in xfconf is the actual active profile.
We can't trust this check 100% because we currently can't compare the EDID value in xfconf with connected display/s EDID, please see #1.
But if your display/s are always the same, then the check could be considered reliable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant