双显示器设置:xrandr 与 xorg.conf

双显示器设置:xrandr 与 xorg.conf

众所周知,在 GNU/Linux 上设置双显示器非常有趣!在花了几天时间摆弄 xorg.conf 之后,我终于可以得到我想要的东西(两个屏幕并排,窗口可以从一个屏幕拖到另一个屏幕),只需启动 X,然后手动调用:

xrandr --output CRT2 --right-of DFP2

我正在使用 RandR 1.3,因为 Xinerama 不适用于我的设置(并且似乎在某种程度上也已经过时了)。

根据本网站,我应该能够通过我的 xorg.conf 静态地实现相同的效果 - 但是,我似乎无法让它正常工作。

我正在为我的 ATI 卡、GNOME 2.32.1 使用 fglrx 驱动程序,这是我的 xorg.conf:

Section "ServerFlags"
    Option      "RandR" "on"
EndSection

Section "Device"
    Identifier  "Device"
    Driver      "fglrx"
    BusID       "PCI:1:0:0"
    Option      "Monitor-DFP2"      "Monitor0"
    Option      "Monitor-CRT2"      "Monitor1"
EndSection

Section "Monitor"
    Identifier      "Monitor0"
EndSection

Section "Monitor"
    Identifier      "Monitor1"
    Option          "RightOf"       "Monitor0"
EndSection

Section "Screen"
    Identifier      "Screen"
    Device          "Device"
    Monitor         "Monitor0"
    DefaultDepth     24
    SubSection "Display"
        Depth     24
        Modes     "1920x1080"
        Virtual   3840 1080
    EndSubSection
EndSection

对我来说,这看起来与上述网站上推荐的设置非常相似,但是,我只会在两个显示器上获得相同的图像。同样,我可以随后调用 xrandr 来实现所需的效果。

有什么想法可以修复我的 xorg.conf 吗?

答案1

您忘记了屏幕部分中的“监视器”条目。

见下文:

Section "Device"
        Identifier     "nvidia"
        Driver "nouveau"
        Option "Monitor-DVI-D-0" "samsung"
        Option "Monitor-VGA-1" "acer"
EndSection


Section "Monitor"
          Identifier   "samsung"
        Option "PreferredMode" "1280x1024_60.00"
EndSection


Section "Monitor"
          Identifier   "acer"
        Option "PreferredMode" "1280x1024_60.00"
          Option "RightOf" "samsung"
EndSection

Section "Screen"
    Identifier "screen1"
   Monitor "samsung"
    DefaultDepth 24
      SubSection "Display"
       Depth      24
       Virtual 2560 2048
      EndSubSection
    Device "nvidia"
EndSection

Section "ServerLayout"
    Identifier "layout1"
    Screen "screen1"
EndSection

答案2

我有 Fedora 14,它在 xorg.conf 中指定了双显示器,使用 ATI 专有 fglrx 驱动程序,桌面分布在两个显示器上。

我记得我大约aticonfig --initial=dual-head在一年前生成过 xorg.conf,并对其进行了一些调整。试试看。作为参考,这是我的 xorg.conf。

Section "ServerLayout"
    Identifier     "aticonfig Layout"
    Screen      0  "aticonfig-Screen[0]-0" 0 0
EndSection

Section "Files"
EndSection

Section "Module"
EndSection

Section "Monitor"
    Identifier   "aticonfig-Monitor[0]-0"
    Option      "VendorName" "ATI Proprietary Driver"
    Option      "ModelName" "Generic Autodetecting Monitor"
    Option      "DPMS" "true"
EndSection

Section "Monitor"
    Identifier   "0-DFP3"
    Option      "VendorName" "ATI Proprietary Driver"
    Option      "ModelName" "Generic Autodetecting Monitor"
    Option      "DPMS" "true"
    Option      "PreferredMode" "1920x1200"
    Option      "TargetRefresh" "60"
    Option      "Position" "0 0"
    Option      "Rotate" "normal"
    Option      "Disable" "false"
EndSection

Section "Monitor"
    Identifier   "0-DFP4"
    Option      "VendorName" "ATI Proprietary Driver"
    Option      "ModelName" "Generic Autodetecting Monitor"
    Option      "DPMS" "true"
    Option      "PreferredMode" "1280x1024"
    Option      "TargetRefresh" "60"
    Option      "Position" "1920 176"
    Option      "Rotate" "normal"
    Option      "Disable" "false"
EndSection

Section "Device"
    Identifier  "aticonfig-Device[0]-0"
    Driver      "fglrx"
    Option      "Monitor-DFP3" "0-DFP3"
    Option      "Monitor-DFP4" "0-DFP4"
    BusID       "PCI:2:0:0"
EndSection

Section "Screen"
    Identifier "aticonfig-Screen[0]-0"
    Device     "aticonfig-Device[0]-0"
    Monitor    "aticonfig-Monitor[0]-0"
    DefaultDepth     24
    SubSection "Display"
        Viewport   0 0
        Virtual   3200 3200
        Depth     24
    EndSubSection
EndSection

答案3

我的最终目标和你的相同:

我想要两个相邻的屏幕,窗口可以从一个屏幕拖动到另一个屏幕

这是我在 Kubuntu 12.04 上使用 ATI 专有驱动程序(与您使用的相同)执行此操作的方法。这前两个步骤对我来说至关重要。(如果没有它们,我的双显示器设置就会出现各种问题。)

sudo apt-get --purge remove fglrx*
sudo apt-get install fglrx-updates fglrx-amdcccle-updates

通过运行 GUI 工具设置监视器从 root shell

$ sudo -s
# amdcccle

取消选中“克隆”选项。足够的就我的情况而言。请注意,除非我按照上述方法启动它,否则无法使该 GUI 实用程序工作。

---引用--- 如今的 X 很少需要手动配置。X 现在会自动使用合理的默认值进行配置。GNOME 和 KDE 都提供了 GUI 实用程序,用于自定义超出这些默认值的设置(如果您愿意)。

但是,有时您需要手动修改配置,超出这些工具允许的范围...---结束引用---

以上内容对我来说是正确的。从您的问题来看,我不明白为什么对您来说不是这样。我不需要调整 Xorg.conf 或 xrandr。但是,当我移动到 3 个显示器时,我必须调整配置文件中的几项内容,但在我取消选中 GUI 配置工具中的“克隆”设置后,我从未遇到显示器恢复为“克隆”的问题。

相关内容