How to get display serial numbers for use in a script?

xrandr --props displays lots of info, including every display’s EDID in hex (but not decoded).
That is the only way I can find to get EDID info.
Several other methods are described online, such as monitor-edid, but none of those generate any output. Maybe I’m using them wrong (I can’t find documentation)?
How does xrandr get the EDID info?
Any way to report it one --output at a time rather than all together?

I can get the serial number for the first --output with something like:
xrandr --props | edid-decode | grep Serial | grep Display

I haven’t yet checked whether that is robust enough for the range of systems I hope to use it on.

I could write a program to parse the output of xrandr --props and split it by display and feed each to edid-decode. But it seems like there must be some cleaner way that I’m missing.

Within the script I want to write, what I hope to have is a way to test for a specific serial number (hard coded in the script) and if it is present do some operation, which in most cases requires the --output associated with that serial number. The script would have separate different sections for each of several serial numbers. The key is to be able to ask if a specific serial number is present and if so what --output

1 Like