「如何使用Linux查看显示器信息?」 (linux 查看 显示器)

如何使用Linux查看显示器信息?

在Linux系统下,我们经常需要查看显示器的相关信息,以确保它在正确的分辨率下工作,并且可以优化配置,使显示效果更佳。那么,该如何使用Linux查看显示器信息呢?下面将介绍三种不同的命令来实现这个目标。

1. xrandr

xrandr是一个命令行工具,可用于配置显示器的分辨率、方向和刷新率等。也可以用它来查看显示器的信息。要查看当前连接的显示器,请在终端中输入以下命令:

> xrandr

这将显示您的系统上所有连接的显示器的信息。对于每个连接的显示器,您将看到其名称和支持的分辨率以及刷新率。例如,以下是xrandr输出的一部分:

> Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192

> HDMI-1 connected primary 1920×1080+0+0 (normal left inverted right x axis y axis) 477mm x 268mm

> 1920×1080 60.00*+ 50.00 59.94

> 1680×1050 59.88

> 1600×900 60.00

> 1280×1024 75.02 60.02

> 1440×900 59.90

> 1280×720 60.00 50.00 59.94

在这个例子中,HDMI-1是连接的显示器的名称。该显示器的分辨率为1920×1080,并支持60Hz和50Hz的刷新率。

2. edid-decode

另一个命令行工具是edid-decode,它允许您查看显示器的EDID信息。EDID是一种包含显示器制造商和产品信息的数据格式。要使用edid-decode,请在终端中输入以下命令:

> sudo apt-get install edid-decode

> sudo get-edid | edid-decode

之一个命令将安装edid-decode,第二个命令将输出连接的显示器的EDID信息。以下是edid-decode输出的一部分:

> EDID version: 1.3

> Manufacturer: AOC

> Model: 2250W

> Serial number: 0000

> Week: 38

> Year: 2023

> EDID block checksum: 0x4b

在这个例子中,显示器的制造商是AOC,型号是2250W,生产日期是2023年9月。

3. hwinfo

hwinfo是一个通用的硬件信息和诊断工具,可在Linux系统上运行。它允许您查看与显示器相关的详细信息,例如分辨率、屏幕大小和支持的制造商等。要使用hwinfo,请在终端中输入以下命令:

> sudo apt-get install hwinfo

> sudo hwinfo –monitor

之一个命令将安装hwinfo,第二个命令将显示与显示器相关的详细信息。以下是hwinfo输出的一部分:

> 01: None 00.0: 10002 Monitor

> [Created at monitor.124]

> Unique ID: rdCR.VTJg_JRCVU8

> Hardware Class: monitor

> Model: “DELL P2314H”

> Vendor: DELL

> Device: eisa 0x5cc1

> Resolution: 1920×1080@60Hz

> Size: 510×290 mm

> Year of Manufacture: 2023

在这个例子中,显示器的制造商是DELL,型号是P2314H,分辨率为1920×1080,尺寸为510x290mm。

结论

这三种命令都非常有用,可以帮助您查看与显示器相关的详细信息。根据您的需求,您可以选择其中任何一个命令来获取特定的信息。无论是xrandr、edid-decode还是hwinfo,它们都是轻便且非常易于使用的命令行工具。

相关问题拓展阅读:

linux下lvds和vga双屏怎么调

你好,楼主:

RandR是对X11的一个扩展协议,允许在不重启X的情况下修改输出的一些参数并使之生效,xrandr是该协议的命令行界面,它的功能之一就是用来设置双屏显示。

缺省情况下,外接显示器後启用的是屏幕复制模式,即两个屏幕显示完全相同的内容。使用命令xrandr -q查看当前的输出状态:

Screen 0: minimum 320 x 200, current 1920 x 1080, maximum 8192 x 8192 LVDS1 connected 1280×800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm 1280×800 60.0+ 60.0 50.0

1024×768 75.1 70.1 60.0

800×600 72.2 75.0 60.3 56.2

768×576 75.0 72.0 60.0

640×480 72.8 75.0 60.0 59.9

VGA1 connected 1920×1080+0+0 (normal left inverted right x axis y axis) 509mm x 286mm 1920x.0+ 1680x.0

1280x.0 60.0

1440×900 59.9

1280×960 60.0

1024×768 75.1 70.1 60.0

832×624 74.6

800×600 72.2 75.0 60.3 56.2

640×480 72.8 75.0 66.7 60.0

720×400 70.1

HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) DP3 disconnected (normal left inverted right x axis y axis)

可见,笔记本电脑的屏幕输出(LVDS1)的显示分辨率是1280×800,外接显示器的输出(VGA1)的分辨率是1920×1080。两个输出在整个虚拟屏幕(名称:Screen 0;当前大小:1920×1080;更大:8192×8192)上的坐标都是+0+0。所以在外接显示器中可以看到屏幕左上角有一个1280×800分辨率的小屏幕。

屏幕复制模式判猜最常用於外接投影仪,现在我需要两个屏幕分别显示在各自的显示器中,并在两个屏幕中显示不同的内容(也就是Windows下设置双屏显示时选择的扩展模式)。

由於宴仔我将笔记本电脑放在外接显示器的左边,所以为了操作的自然,使用命令xrandr –output VGA1 –right-of LVDS1将外接显示器的输出在虚拟屏幕上的位置设置在笔记本电脑的输出的右边,示意图如下:

这样,两个显示器中就可以显示不同的内容了。由於属於同一个虚拟屏幕,当然也可以将一掘祥型个窗口跨过边界从一个显示器拖到另一个显示器中。再使用命令xrandr -q查看现在的输出状态:

Screen 0: minimum 320 x 200, current 3200 x 1080, maximum 8192 x 8192 LVDS1 connected 1280×800+0+0 (normal left inverted right x axis y axis) 261mm x 163mm 1280×800 60.0+ 60.0 50.0

1024×768 75.1 70.1 60.0

800×600 72.2 75.0 60.3 56.2

768×576 75.0 72.0 60.0

640×480 72.8 75.0 60.0 59.9

VGA1 connected 1920×1080+1280+0 (normal left inverted right x axis y axis) 509mm x 286mm 1920x.0+ 1680x.0

1280x.0 60.0

1440×900 59.9

1280×960 60.0

1024×768 75.1 70.1 60.0

832×624 74.6

800×600 72.2 75.0 60.3 56.2

640×480 72.8 75.0 66.7 60.0

720×400 70.1

HDMI1 disconnected (normal left inverted right x axis y axis) DP1 disconnected (normal left inverted right x axis y axis) HDMI2 disconnected (normal left inverted right x axis y axis) DP2 disconnected (normal left inverted right x axis y axis) DP3 disconnected (normal left inverted right x axis y axis)

使用xrandr做的设置只对当前的X会话有效,重启後恢复原样。使设置持久化的方法为修改xorg.conf或设置自动执行命令。据说有一些图形界面封装的xrandr的前端,完善的桌面环境如GNOME和KDE应该也是可以在图形界面中设置的,不过我所使用的XFCE目前似乎只能启用/禁用复制模式,而不支持在图形界面中设置扩展模式。

下面的脚本用来简化双屏显示的设置:

#!/bin/bash

# Restart trayer and cairo-dock which I use on my desktop

restart_widget()

{

killall trayer

killall cairo-dock

# Another script which starts trayer and set some options

mytrayer

cairo-dock &

}

set_dualhead()

{

xrandr –output LVDS1 –auto

xrandr –output VGA1 –auto

xrandr –output VGA1 –right-of LVDS1

restart_widget

}

set_lvds()

{

xrandr –output VGA1 –off

xrandr –output LVDS1 –auto

restart_widget

}

set_vga()

{

xrandr –output LVDS1 –off

xrandr –output VGA1 –auto

restart_widget

}

if ; then

set_dualhead

exit

fi

case “$1x” in

“lvdsx”) set_lvds;;

“vgax”) set_vga;;

*) echo ‘Unknown parameter !’;;

esac

  

  可以通过xrandr之款Linux双屏工具来调节。

  1、列出屏幕支持分辨率:

  # xrandr -q

  Screen 0: minimum 320 x 200, current 1280 x 800, maximum 1280 x 1280

  VGA disconnected (normal left inverted right x axis y axis)

  LVDS connected 1280×800+0+0 (normal left inverted right x axis y axis) 304mm x 190mm

  1280x.0*+

  1024x.0

  800x.3

  640x.9

  TV disconnected (normal left inverted right x axis y axis)

  2、设置屏幕分辨率

  根据上面查到的分辨率,我们可以手动设置,下面将分辨率设置为 1024×768 , 刷新率为60Hz。

  # xrandr -s 1024×768 -r 60

  3、查看所有显示器属性

  # xrandr –prop

  Screen 0: minimum 320 x 200, current 1024 x 768, maximum 1280 x 1280

  VGA disconnected (normal left inverted right x axis y axis)

  LVDS connected 1024×768+0+0 (normal left inverted right x axis y axis) 304mm x 190mm

  EDID_DATA:

  00ffffffffffff00320c

e13780aba28

010101

121b007d

be

fe004c

cc43440a000000fe

  004c2d544c4e3100b2

  PANEL_FITTING: full_aspect

  supported: centerfull_aspect full

  BACKLIGHT_CONTROL: combination

  腔首supported: nativelegacycombination kernel

  BACKLIGHT:(0xb) range: (0,14203)

  1280x.0 +

  1024x.0*

  800x.3

  伍凳数640x.9

 粗陵 TV disconnected (normal left inverted right x axis y axis)

  HUE: 0 (0x) range: (0,255)

  SATURATION: 96 (0x) range: (0,255)

  CONTRAST: 96 (0x)range: (0,255)

  BRIGHTNESS: 128 (0x) range: (0,255)

  BOTTOM: 37 (0x) range: (0,100)

  RIGHT: 46 (0xe) range: (0,100)

  TOP: 36 (0x) range: (0,100)

  LEFT: 54 (0x) range: (0,100)

  TV_FORMAT: NTSC-M

  supported: NTSC-MNTSCNTSC-JPAL-M

  PAL-NPAL

  4、设置双屏(dual monitor)显示

  如果你设置有一个LED(笔记本显示器),再外界一个 VGA 显示器,用 ”xrandr —prop“ 命令就会得到类似 LVDS1 和 VGA1 列表。可以设置这两个双屏显示。

  xrandr –output LVDS1 –mode 1280×800 –output VGA1 –mode 1024×768 –above LVDS1

linux 查看 显示器的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于linux 查看 显示器,「如何使用Linux查看显示器信息?」,linux下lvds和vga双屏怎么调的信息别忘了在本站进行查找喔。


数据运维技术 » 「如何使用Linux查看显示器信息?」 (linux 查看 显示器)