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.
Yes there is, read-edid hardware information-gathering tool for VESA PnP monitors. This tool have two commands:
get-edid
andparse-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:
Then try:
Case where
get-edid
does not show all monitorsLike mine, I have:
get-edid
shows only the external monitor which is plugged to VGA port.Install
read-edid
Read EDID info directly from SYSFS tree, it should show all detected monitors
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:xrandr
,xrandr --prop
andxrandr --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
) andapt install edid-decode
, then: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 (version3.0.2
). In my case,get-edid
outputs additional characters after the end that lead to a warning fromedid-decode
andparse-edid
outputs random garbage inModelName
andIdentifier
fields.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
This worked for me on Ubuntu 18.04.
The monitor is connected using HDMI: