Skip to main content

Module display

Module display 

Source
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 to xrandr --current when no sysfs displays are found.
  • macOS: Parses system_profiler SPDisplaysDataType output.
  • Windows: Calls EnumDisplayDevicesW + EnumDisplaySettingsW via 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 --current output.