Linux Retrieve Monitor Names

Linux retrieve monitor names

sudo get-edid didn't work for me. (EDIT: now works on another computer, Lubuntu 14.10; I'd blame BIOS differences but that's a random guess...)

Anyway under X, xrandr --verbose prints the EDID block. Here is a quick and dirty way to extract it and pass to parse-edid:

#!/bin/bash
xrandr --verbose | perl -ne '
if ((/EDID(_DATA)?:/.../:/) && !/:/) {
s/^\s+//;
chomp;
$hex .= $_;
} elsif ($hex) {
# Use "|strings" if you dont have read-edid package installed
# and just want to see (or grep) the human-readable parts.
open FH, "|parse-edid";
print FH pack("H*", $hex);
$hex = "";
}'

Read monitor name like MultiMonitor tool does

The standard approach, which is based on EnumDisplayDevices and has described in several previous Qs [1, 2], can be written like this in Delphi:

procedure TForm1.FormCreate(Sender: TObject);
var
dd, md: TDisplayDevice;
begin

ListBox1.Items.BeginUpdate;
try
ListBox1.Clear;
FillChar(dd, SizeOf(dd), 0);
dd.cb := SizeOf(dd);
FillChar(md, SizeOf(md), 0);
md.cb := SizeOf(md);
var i := 0;
while EnumDisplayDevices(nil, i, dd, 0) do
begin
var j := 0;
while EnumDisplayDevices(@dd.DeviceName[0], j, md, 0) do
begin
ListBox1.Items.Add(md.DeviceString);
Inc(j);
end;
Inc(i);
end;
finally
ListBox1.Items.EndUpdate;
end;

end;

On my system, this correctly identifies my three Dell monitors but fails to identify my Samsung wall-mounted TV ("Generic PnP Monitor").

Screenshot of a Delphi application showing my four displays in a list box: Dell U2211H (Digital), Allmän PnP-bildskärm, Dell UP2716D (DP), and Dell UP2716D (DP)

Monitor Details in Linux (Ubuntu)

If you happen to be able to start an X11 server, you could try to run xdpyinfo and xrandr and look into the log of the Xorg server, probably in /var/log/Xorg.0.log



Related Topics



Leave a reply



Submit