List connected displays with details and ASCII layout diagram.
Like lsusb, lspci, lscpu — but for displays.
- EDID parsing from
/sys/class/drm/*/edid: manufacturer, model, serial number - Resolution, position, rotation via xrandr (fallback: kscreen-doctor, wlr-randr)
- ASCII art layout diagram with correct proportions
- JSON output for scripting
- Works on X11 and Wayland (KDE, Sway, etc.)
- No external dependencies, Python 3.6+
# System-wide
sudo cp lsdisplay.py /usr/local/bin/lsdisplay
sudo chmod +x /usr/local/bin/lsdisplay
# Or user-local
cp lsdisplay.py ~/.local/bin/lsdisplay
chmod +x ~/.local/bin/lsdisplaylsdisplay # Full output with layout diagram
lsdisplay --short # Compact one-line-per-display
lsdisplay --json # JSON output for scripting
lsdisplay --no-layout # Skip the ASCII art diagram
lsdisplay --version # Show versionCONNECTED DISPLAYS
==================
HDMI-A-2 1440x2560+1441+0 27" 75Hz Iiyama PL2792Q HDMI S/N:1152032422031 rot=left
DP-4 1440x2560+0+0 27" 75Hz Iiyama PL2792Q DisplayPort S/N:1152031921274 rot=left [PRIMARY]
HDMI-A-5 5376x3024+0+2561 65" 60Hz Samsung QN800D HDMI S/N:16780800
Total: 3 display(s) connected
LAYOUT
======
+--------------+ +--------------+
| | | |
| DP-4* | | HDMI-A-2 |
| | | |
+--------------+ +--------------+
+------------------------------+
| |
| HDMI-A-5 |
| |
+------------------------------+
- Python 3.6+
- Linux with
/sys/class/drm(any modern kernel) xrandr(X11) orkscreen-doctor(KDE Wayland) orwlr-randr(wlroots Wayland)
- Scans
/sys/class/drm/card*/edidfor raw EDID data - Parses EDID to extract PNP manufacturer ID, monitor name, serial number
- Maps PNP IDs to human-readable names (Samsung, Dell, Iiyama, etc.)
- Uses
xrandroutput for resolution, position, rotation - Draws ASCII art layout proportional to actual pixel dimensions
GPL-2.0. See LICENSE for the full text.