Created
October 13, 2025 11:58
-
-
Save sulincix/9ceccb982b6a80f6cc29dc19e5171237 to your computer and use it in GitHub Desktop.
Read monitor name from edid file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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