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").
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
Remove Empty Lines in a Text File via Grep
Pass Output as an Argument for Cp in Bash
Execute Two Commands with Docker Exec
Permissions Required to Move File to Different Directory in Unix/Linux
How to Query X11 Display Resolution
Is There an Acceptable Linux Targeted Gui Client for Git-Svn
How to Get All Parent Processes and All Subprocesses with 'Pstree'
How to Test If Your Linux Support Sse2
How to Enable Bash in Windows 10 Developer Preview
Linux Execute Command Remotely
What Is the "Current" in Linux Kernel Source
Gcc Compilation "Cannot Compute Suffix of Object Files: Cannot Compile"
Define Function in Unix/Linux Command Line (E.G. Bash)
Posix Shared Memory and Semaphores Permissions Set Incorrectly by Open Calls