Expand description
Display detection and EDID parsing.
This module provides cross-platform detection of connected displays, including resolution, refresh rate, and monitor name/serial extraction from raw EDID blobs.
§Platform Support
- Linux: Reads natively from
/sys/class/drm(status, modes, and raw EDID bytes). Falls back toxrandr --currentwhen no sysfs displays are found. - macOS: Parses
system_profiler SPDisplaysDataTypeoutput. - Windows: Calls
EnumDisplayDevicesW+EnumDisplaySettingsWvia user32.dll FFI.
Functions§
- detect_
displays - Detect connected displays and return a list of human-readable strings describing each display (name, resolution, and refresh rate).
- format_
refresh_ rate - Format a refresh rate value for display.
- get_
monitor_ name_ for_ port - Look up the monitor name for a given DRM connector port name by reading
the EDID from sysfs (
/sys/class/drm/<entry>/edid). - parse_
monitor_ name_ from_ edid - Parse the monitor’s human-readable name from a raw EDID binary blob.
- parse_
refresh_ rate_ from_ edid - Parse the refresh rate (in Hz) from the first Detailed Timing Descriptor (DTD) block in a raw EDID binary blob.
- parse_
serial_ number_ from_ edid - Parse the serial number from a raw EDID binary blob.
- parse_
xrandr_ displays - Parse connected display information from
xrandr --currentoutput.