Skip to content

Instantly share code, notes, and snippets.

@sulincix
Created October 13, 2025 11:58
Show Gist options
  • Save sulincix/9ceccb982b6a80f6cc29dc19e5171237 to your computer and use it in GitHub Desktop.
Save sulincix/9ceccb982b6a80f6cc29dc19e5171237 to your computer and use it in GitHub Desktop.
Read monitor name from edid file
#!/usr/bin/env python3
# https://en.wikipedia.org/wiki/Extended_Display_Identification_Data
edid_file = "/sys/class/drm/card1-eDP-1/edid"
with open(edid_file,"rb") as f:
edid = f.read()
name = ""
for c in edid[0x4d:]:
if chr(c).isprintable():
name += chr(c)
else:
break
print(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment