Reputation:
I'm writing a cross platform library which provides low level access to the window system (Win32/Cocoa/X11/Wayland). Right now I'm working on getting info about connected monitors. My "screen-info" utility writes the following output with my current dual monitor setup:
- name: DVI-D-0
size (pixels): (1920, 1080)
physical size (mm): (477, 268)
resolution (px/cm): (40, 40)
- name: DVI-I-1
size (pixels): (1680, 1050)
physical size (mm): (433, 271)
resolution (px/cm): (38, 38)
The name was obtained by name
member of the XRRMonitorInfo
structure provided by the Xrandr extension library. In my [MATE] control panel, it displays the vendor names for each connected monitor (Acer Technologies and Samsung Electric Company respectively).
I've been digging through the MATE source code to see how they got the vendor name, but it's just been leading me in circles so far. Is there any way to get information such as vendor names using the Xrandr library? If not, how else could this be accomplished? Any help is appreciated.
Upvotes: 3
Views: 4717
Reputation: 644
It looks like you can get this information from reading the monitor's EDID. Using either get-edid
or xrandr --verbose
, you can get the EDID block. parse-edid
can decode the binary data into readable info, which will contain monitor names.
The EDID utils here will likely have usable code to review: http://www.polypux.org/projects/read-edid/
And see also this Stack Overflow post: Linux retrieve monitor names
Upvotes: 1