82

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.

icyrock.com
  • 1,049

9 Answers9

69

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
Pablo Bianchi
  • 17,371
thom
  • 7,742
38

Case where 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 tree, it should show all detected monitors

     ls /sys/class/drm/*/edid | xargs -i{} sh -c "echo {}; parse-edid < {}"
    
user.dz
  • 49,176
28
$ 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".
Zanna
  • 72,312
thom
  • 7,742
20

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)
13

This gives you all the information you need:

dbus-send --session --print-reply --dest=org.gnome.Mutter.DisplayConfig /org/gnome/Mutter/DisplayConfig org.gnome.Mutter.DisplayConfig.GetCurrentState

12

xrandr, xrandr --prop and xrandr --verbose will give you some information with different level of detail.

Manufacturer-provided information can be found in the EDID format.

To get and decode EDID, first check xrandr output to find out the used interface (e.g. eDP-1) and apt install edid-decode, then:

edid-decode </sys/class/drm/card0-eDP-1/edid

Example output you can find here. Replace eDP-1 with your interface if needed.

Alternatively, xrandr --prop outputs EDID in hex format that you can feed to this online EDID decoder.

I don't recommend using read-edid package because I had negative experiences with it (version 3.0.2). In my case, get-edid outputs additional characters after the end that lead to a warning from edid-decode and parse-edid outputs random garbage in ModelName and Identifier fields.

user
  • 473
8

This worked for me on Ubuntu 18.04.
The monitor is connected using HDMI:

grep -i "monitor name" /var/log/syslog
jwalker
  • 161
1

Some window managers provide commands for listing output details. This one works if you are running swaywm:

$ swaymsg -t get_outputs

It generates the following output

Output eDP-1 'Unknown 0x408D 0x00000000'
  Current mode: 1920x1080 @ 60.049000 Hz
  Position: 0,0
  Scale factor: 1.000000
  Scale filter: nearest
  Subpixel hinting: unknown
  Transform: normal
  Workspace: 10
  Max render time: off
  Adaptive sync: disabled
  Available modes:
    640x480 @ 60.049000 Hz
    800x600 @ 60.049000 Hz
    1024x768 @ 60.049000 Hz
    1280x720 @ 60.049000 Hz
    1280x800 @ 60.049000 Hz
    1440x900 @ 60.049000 Hz
    1280x1024 @ 60.049000 Hz
    1680x1050 @ 60.049000 Hz
    1920x1080 @ 60.049000 Hz

Output HDMI-A-1 'Samsung Electric Company C24F390 SRNABC123' (focused) Current mode: 1920x1080 @ 60.000000 Hz Position: 1920,0 Scale factor: 1.000000 Scale filter: nearest Subpixel hinting: unknown Transform: normal Workspace: 1 Max render time: off Adaptive sync: disabled Available modes: 720x400 @ 70.082001 Hz 640x480 @ 59.939999 Hz 640x480 @ 60.000000 Hz 640x480 @ 66.667000 Hz 640x480 @ 72.808998 Hz 720x480 @ 59.939999 Hz 720x480 @ 59.939999 Hz 720x480 @ 60.000000 Hz 720x480 @ 60.000000 Hz 720x576 @ 50.000000 Hz 720x576 @ 50.000000 Hz 800x600 @ 56.250000 Hz 800x600 @ 60.317001 Hz 800x600 @ 72.188004 Hz 1024x768 @ 60.004002 Hz 1024x768 @ 70.069000 Hz 1280x720 @ 50.000000 Hz 1280x720 @ 50.000000 Hz 1280x720 @ 59.939999 Hz 1280x720 @ 60.000000 Hz 1280x720 @ 60.000000 Hz 1280x800 @ 59.910000 Hz 1440x900 @ 59.901001 Hz 1280x1024 @ 60.020000 Hz 1600x900 @ 60.000000 Hz 1680x1050 @ 59.882999 Hz 1920x1080 @ 50.000000 Hz 1920x1080 @ 59.939999 Hz 1920x1080 @ 60.000000 Hz 1920x1080 @ 60.000000 Hz

mrpandey
  • 193
0

A really nice tools to show info about all outputs, HDR, color mode, and many more details: drm_info

On KDE this also provides a great output: kscreen-doctor -o