使用 /etc/X11/xorg.conf 时 lightdm 循环重启

使用 /etc/X11/xorg.conf 时 lightdm 循环重启

我有一台 Acer H233H 显示器,想将分辨率设置为 1920x1080。我在 Google 上搜索了一下,发现必须使用/etc/X11/xorg.conf。我使用 创建了此文件sudo Xorg -configure,将其复制到/etc/X11/并重新启动 lig​​htdm,但 lightdm 却循环重新启动。

我的xorg.conf

Section "ServerLayout"
Identifier     "X.org Configured"
Screen      0  "Screen0" 0 0
InputDevice    "Mouse0" "CorePointer"
InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath   "/usr/lib/xorg/modules"
FontPath     "/usr/share/fonts/X11/misc"
FontPath     "/usr/share/fonts/X11/cyrillic"
FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath     "/usr/share/fonts/X11/Type1"
FontPath     "/usr/share/fonts/X11/100dpi"
FontPath     "/usr/share/fonts/X11/75dpi"
FontPath     "built-ins"
EndSection

Section "Module"
Load  "glx"
EndSection

Section "InputDevice"
Identifier  "Keyboard0"
Driver      "kbd"
EndSection

Section "InputDevice"
Identifier  "Mouse0"
Driver      "mouse"
Option      "Protocol" "auto"
Option      "Device" "/dev/input/mice"
Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier   "Monitor0"
VendorName   "Monitor Vendor"
ModelName    "Monitor Model"
EndSection

Section "Device"
Identifier  "Card0"
Driver      "nvidia"
BusID       "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device     "Card0"
Monitor    "Monitor0"
SubSection "Display"
    Viewport   0 0
    Depth     1
EndSubSection
SubSection "Display"
    Viewport   0 0
    Depth     4
EndSubSection
SubSection "Display"
    Viewport   0 0
    Depth     8
EndSubSection
SubSection "Display"
    Viewport   0 0
    Depth     15
EndSubSection
SubSection "Display"
    Viewport   0 0
    Depth     16
EndSubSection
SubSection "Display"
    Viewport   0 0
    Depth     24
EndSubSection
EndSection

UPD:我试过了https://askubuntu.com/a/617318/404225。我的/usr/share/X11/xorg.conf.d/10-monitor.conf现在是:

Section "Monitor"
Identifier "Monitor0"
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
EndSection
Section "Screen"
Identifier "Screen0"
Device "Monitor0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1920x1080_60.00"
EndSubSection
EndSection

答案1

为什么使用 xorg.conf 来设置分辨率而不是设置->显示?

要使其再次工作,请按ctrl+ alt+F1打开 tty,然后登录。
删除您创建的 xorg.conf 文件并重新启动。

如果您想要的分辨率缺失,请使用:

  • cvt 1920 1080 60创建一个新的模式行。
  • xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync 创建一个新模式。

然后创建文件/usr/share/X11/xorg.conf.d/10-monitor.conf
内容如下:

Section "Monitor"
  Identifier "Monitor0"
  <INSERT MODELINE HERE>
EndSection
Section "Screen"
  Identifier "Screen0"
  Device "<INSERT DEVICE HERE>"
  Monitor "Monitor0"
  DefaultDepth 24
  SubSection "Display"
    Depth 24
    Modes "<INSERT MODENAME HERE>"
  EndSubSection
EndSection

相关内容