在 X11 上,我试图让内部和外部显示器同时工作。nvidia-xconfig
生成这个xorg.conf
文件:
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 470.94
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
问题是它只能在外部显示器上工作(当然,任何外部显示器)。现在我正在尝试让内部监视器正常工作。当我重新启动sddm
、xrandr
或任何其他程序时,尽管仍连接着 HDMI 电缆,但无法看到任何其他显示器/输出设备。请注意,它不会被设置为“已连接”或“已断开连接”,xrandr -q
仅返回正在运行的监视器。但是,此命令仍然会找到所有监视器:
[lunar@J-Laptop 06:00:31pm /etc/X11]$ ls /sys/class/drm/*/edid | xargs -i{} sh -c "echo {}; parse-edid < {}"
/sys/class/drm/card0-eDP-1/edid
Checksum Correct
Section "Monitor"
Identifier ""
ModelName ""
VendorName "NCP"
# Monitor Manufactured week 1 of 2018
# EDID version 1.4
# Digital Display
DisplaySize 340 190
Gamma 2.20
Option "DPMS" "false"
Horizsync 162-162
VertRefresh 48-120
# Maximum pixel clock is 340MHz
Modeline "Mode 0" +hsync -vsync
Modeline "Mode 1" +hsync -vsync
EndSection
/sys/class/drm/card1-HDMI-A-1/edid
Checksum Correct
Section "Monitor"
" Identifier "ELEFT195
" ModelName "ELEFT195
VendorName "ELE"
# Monitor Manufactured week 27 of 2018
# EDID version 1.3
# Digital Display
DisplaySize 410 230
Gamma 2.20
Option "DPMS" "false"
Horizsync 30-80
VertRefresh 50-75
# Maximum pixel clock is 230MHz
#Not giving standard mode: 1280x1024, 60Hz
#Not giving standard mode: 800x600, 60Hz
#Not giving standard mode: 1024x768, 60Hz
#Not giving standard mode: 1440x900, 60Hz
#Extension block found. Parsing...
Modeline "Mode 14" -hsync -vsync
Modeline "Mode 0" +hsync +vsync
Modeline "Mode 1" 25.200 640 656 752 800 480 490 492 525 -hsync -vsync
Modeline "Mode 2" 27.027 720 736 798 858 480 489 495 525 -hsync -vsync
Modeline "Mode 3" 74.250 1280 1390 1420 1650 720 725 730 750 +hsync +vsync
Modeline "Mode 4" 74.250 1920 2008 2052 2200 1080 1082 1087 1125 +hsync +vsync interlace
Modeline "Mode 5" 27.027 1440 1478 1602 1716 480 484 487 525 -hsync -vsync interlace
Modeline "Mode 6" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 7" 27.000 720 732 796 864 576 581 586 625 -hsync -vsync
Modeline "Mode 8" 74.250 1280 1720 1760 1980 720 725 730 750 +hsync +vsync
Modeline "Mode 9" 74.250 1920 2448 2492 2640 1080 1082 1089 1125 +hsync +vsync interlace
Modeline "Mode 10" 27.000 1440 1464 1590 1728 576 578 581 625 -hsync -vsync interlace
Modeline "Mode 11" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 12" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 13" 74.250 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
Modeline "Mode 15" -hsync -vsync
Modeline "Mode 16" +hsync +vsync
Modeline "Mode 17" +hsync +vsync interlace
Option "PreferredMode" "Mode 14"
EndSection
现在给我的是与 非常相似的语法xorg.conf
,即使不是完全一样。如何使用它来使内部和外部显示器都工作?没有任何/etc/X11/xorg.conf
,只有我的内部显示器正常工作。
答案1
男人xorg.conf(5):
配置文件可能有多个
Screen
部分。对于正在使用的“屏幕”来说,必须至少有一个。Device
“屏幕”代表图形设备(部分)和监视器(部分)的绑定Monitor
。Screen
如果某个节被活动节引用,则ServerLayout
该节 被视为“活动”...
因此,您可以尝试添加第二个显示器和屏幕部分,并将第二个屏幕部分添加到该serverlayout
部分。使用位置信息字段来定位您的显示器。
Section "Monitor"
Identifier "Monitor1"
Option "DPMS"
EndSection
Section "Screen"
Identifier "Screen1"
Device "Device0"
Monitor "Monitor1"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf 'Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
RightOf
、 LeftOf
、 Above
和Below
是可用于定位第二个屏幕的四个关键字。