Is there a way to query monitor information from command line? For example, get monitor model, similar to e.g. what lspci does for graphic card info, or whether it's currently on or off, things like that.

If possible, what kinds of basic information such as the above can be easily gathered? For example, is it possible to determine if monitor is in portrait or landscape position? Or if it has built-in speakers or not?

Command line is the preference, but if there's a GUI method, I'd like to hear about it, too.

up vote 11 down vote accepted
$ grep "NVIDIA(GPU-0)" /var/log/Xorg.0.log |head -17| cut -d\: -f2
 Display (Samsung SA300/SA350 (DFP-0)) does not support NVIDIA
     3D Vision stereo.
 The EDID for Samsung SA300/SA350 (DFP-0) contradicts itself
     mode "1920x1080" is specified in the EDID; however, the
     EDID's valid VertRefresh range (56.000-75.000 Hz) would
     exclude this mode's VertRefresh (50.0 Hz); ignoring
     VertRefresh check for mode "1920x1080".
 The EDID for Samsung SA300/SA350 (DFP-0) contradicts itself
     mode "1280x720" is specified in the EDID; however, the
     EDID's valid VertRefresh range (56.000-75.000 Hz) would
     exclude this mode's VertRefresh (50.0 Hz); ignoring
     VertRefresh check for mode "1280x720".
 The EDID for Samsung SA300/SA350 (DFP-0) contradicts itself
     mode "720x576" is specified in the EDID; however, the
     EDID's valid VertRefresh range (56.000-75.000 Hz) would
     exclude this mode's VertRefresh (50.0 Hz); ignoring
     VertRefresh check for mode "720x576".
  • first line is the command. Note that this is not de official way to get vendor/model info from the monitor (but tragically it is often the only way), also it is GPU-vendor dependent. – thom Nov 7 '13 at 3:32
  • Thanks - looking into /var/log/Xorg.0.log actually helps - it's a pity this is the only way. – icyrock.com Nov 7 '13 at 3:52
  • I Found a howto: wiki.xbmc.org/… – thom Nov 7 '13 at 4:07
  • Thanks for the link, this looks interesting - I'll check it out. – icyrock.com Nov 7 '13 at 4:09

Yes there is, read-edid hardware information-gathering tool for VESA PnP monitors. This tool have two commands: get-edid and parse-edid: tools to retrieve and interpret monitor specifications using the VESA VBE DDC protocol. EDID (Extended Display Identification Data) is a metadata format for display devices to describe their capabilities to a video source.

First:

sudo apt-get install read-edid

Then try:

sudo get-edid | parse-edid
  • Thanks thom - can you clarify how can I get monitor model using get-edid / parse-edid? When I ran the above, it did not print anything (not even in Section "Monitor") that would be similar to my monitor manufacturer / model. If that's OK with you, can you paste what you get on your machine and the monitor model you have, just for comparison? – icyrock.com Nov 7 '13 at 2:25
  • Identifier "\QX:2d40" VendorName "\QX" ModelName "\QX:2d40" I have to say that the EDID of my monitor is buggy as hell. So that is not really representative :-) – thom Nov 7 '13 at 2:57
  • Thanks thom - looks similar on my end: ModelName "LGD:8902", so looks like it is representative after all :) Also, it only displays my laptop monitor, but not the external one. – icyrock.com Nov 7 '13 at 3:10
  • A lot of EDIDs are buggy. Manufacturers don't care and driverdevelopers are doing mostly workarounds. Best info is coming from closed source videodrivers. I extract it like this: grep "Display" /var/log/Xorg.0.log |tail -1 for extensive info I use grep "NVIDIA(GPU-0)" /var/log/Xorg.0.log – thom Nov 7 '13 at 3:21

Try

xrandr

(I used the program once when I was playing with dual monitor setup on Archlinux .)

You can find it in the x11-server-utils package. That package contains other stuff to play with like:

  • iceauth, a tool for manipulating ICE protocol authorization records;
  • rgb;
  • sessreg, a simple program for managing utmp/wtmp entries;
  • xcmsdb, a device color characteristic utility for the X Color Management System;
  • xgamma, a tool for querying and setting a monitor's gamma correction;
  • xhost, a very dangerous program that you should never use;
  • xmodmap, a utility for modifying keymaps and pointer button mappings in X;
  • xrandr, a command-line interface to the RandR extension;
  • xrdb, a tool to manage the X server resource database;
  • xrefresh, a tool that forces a redraw of the X screen;
  • xset, a tool for setting miscellaneous X server parameters;
  • xsetmode and xsetpointer, tools for handling X Input devices;
  • xsetroot, a tool for tailoring the appearance of the root window;
  • xstdcmap, a utility to selectively define standard colormap properties;
  • xvidtune, a tool for customizing X server modelines for your monitor. (information found in synaptic package manager)
  • 2
    Thanks Frank - can you clarify how do I get monitor model using xrandr? – icyrock.com Nov 7 '13 at 2:24
  • ahah never use xhost? why – Jack Nov 24 '16 at 22:02

If get-edid does not show all monitors. Like mine, I have:

$ lshw -c display
  *-display               
       description: VGA compatible controller
       product: 3rd Gen Core processor Graphics Controller
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:27 memory:f6400000-f67fffff memory:e0000000-efffffff ioport:f000(size=64)

get-edid shows only the external monitor which is plugged to VGA port.

  1. Install read-edid

    sudo apt-get install read-edid
    
  2. Read edid info directly from sysfs should show all monitors

    ls /sys/class/drm/*/edid | xargs -i{} sh -c "echo {}; parse-edid < {}"
    

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.