FreeBSD 下双显示器的设置

双显示器的好处,除了吸引妹妹羡慕的眼光,的确还是有一些的。譬如,同时使用多个显示器进行工作的好处和不利

实验室的朋友们都转向大屏幕了,淘汰了一些同类型的显示器被我捡了来。我想在FreeBSD下搞一个双显示器来娱乐一下自己,活跃一下单调乏味的码字生活。

Windows 下设置双显示器只需要点点鼠标,FreeBSD 下则需要修改 xorg.conf。当然,过程并不复杂。这个帖子就是我设置双显示器的经验记录,希望对您有所帮助。

第一步:观察显卡和显示器接口

一般台式机的显卡和显示器都提供VGA和DVI接口,或者两个VGA,或者两个DVI,或者一个VGA一个DVI。根据实际情况,选择连线。我的DELL机器是一个VGA一个DVI,所以我准备了一条 Male-Male VGA 线,一条 Male-Male DVI-D 线。(看完这一段,明白了你的码字生活真的好乏味)

DVI线有三种,科普知识见DVI接口。例如,“DVI-I支持数字/模拟转换的接口类型,倘若显示器只有一个DVI接口,那就会搭配支持数字/模拟两种模式的DVI-I。假如显示器有DVI和VGA两种接口,则搭配DVI-D。”

第二步:在 FreeBSD 下查看接口信息

把线连上以后,要查看一下接口的信息,可以用 xrandr 命令。我的机器显示如下信息:

IOU@~$ xrandr 
Screen 0: minimum 320 x 200, current 2560 x 1024, maximum 2560 x 1024
VGA-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm
   1280x1024      60.0*+   75.0  
   1152x864       75.0  
   1024x768       75.0     60.0  
   800x600        75.0     60.3  
   640x480        75.0     59.9  
   720x400        70.1  
DVI-0 connected 1280x1024+1280+0 (normal left inverted right x axis y axis) 338mm x 270mm
   1280x1024      60.0*+   75.0  
   1152x864       75.0  
   1024x768       75.0     60.0  
   800x600        75.0     60.3  
   640x480        75.0     59.9  
   720x400        70.1  
S-video disconnected (normal left inverted right x axis y axis)

第三步:设置 xorg.conf

两个显示器分别起名为 VGA-0 和 DVI-0。有些配置文档说,要设置两个显示器的位置关系,哪个在哪个的左边。在 xorg.conf 里我尝试着没设置,结果是缺省地,VGA-0 应该放在 DVI-0 的左侧,这样鼠标在两个显示器里移动才符合正常人的习惯。如果非要设置,可以

root@~# xrandr --output DVI-0 --right-of VGA-0

我的 xorg.conf 设置如下,根据实际情况,你可能需要局部地修改。Have fun with your dual monitors!

Section "ServerFlags"
        Option         "AutoAddDevices" "Off"
        Option         "Xinerama" "True"
EndSection

Section "Files"
        ModulePath   "/usr/local/lib/xorg/modules"
        FontPath     "/usr/local/lib/X11/fonts/wqy/"
        FontPath     "/usr/local/lib/X11/fonts/misc/"
        FontPath     "/usr/local/lib/X11/fonts/TTF/"
        FontPath     "/usr/local/lib/X11/fonts/OTF"
        FontPath     "/usr/local/lib/X11/fonts/Type1/"
        FontPath     "/usr/local/lib/X11/fonts/100dpi/"
        FontPath     "/usr/local/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
        Load  "extmod"
        Load  "record"
        Load  "dbe"
        Load  "dri"
        Load  "dri2"
        Load  "glx"
EndSection

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

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

Section "Device"
        Identifier  "Card0"
        Driver      "radeon"
        VendorName  "Advanced Micro Devices, Inc. [AMD/ATI]"
        BoardName   "RV370 [Radeon X300]"
        BusID       "PCI:1:0:0"
EndSection

Section "Monitor"
        Identifier   "VGA-0"
        VendorName   "DEL"
        ModelName    "DELL 1703FP"
        Option       "DPMS"
EndSection

Section "Monitor"
        Identifier   "DVI-0"
        VendorName   "DEL"
        ModelName    "DELL 1703FP"
        Option       "RightOf" "VGA-0"
        Option       "DPMS"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "VGA-0"
        SubSection "Display"
                Viewport   0 0
                Virtual   2560 1024
                Depth     24
                Modes     "1280x1024"
        EndSubSection
EndSection

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen         "Screen0"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
        Option         "AIGLX" "True"
        Option         "DRI2" "True"
EndSection

Section "DRI"
        Group 0
        Mode 0660
EndSection

Section "Extensions"
        Option  "Composite" "Enable"
EndSection

补充

后来,换了台主机,intel 的显卡。还是同样的步骤,只是 BusID 不太一样,需要改一下。其他的就没有什么要补充的了。

效果图

效果图以后有机会再上。

小屏幕练就斗鸡眼,宽屏幕练就散光眼。双显示器的确锻炼使用者的注意力,初级阶段是左眼看左屏幕,右眼看有屏幕;高级阶段是左眼看右屏幕,右眼看左屏幕。我希望通过锻炼,能够练就两只火眼金睛,有助于我申请保安里的高档职业—盯监视器。一大堆屏幕摆在面前,保证不放过一个美女。

发表评论

电子邮件地址不会被公开。 必填项已用*标注