X11,xorg.conf配置详解

来源:互联网 发布:送闺蜜新年礼物 知乎 编辑:程序博客网 时间:2024/05/16 03:47

X11,xorg.conf配置详解
X11R7其实就是目前Ubuntu使用的X Server,它于2005年12月被释出,与之前的X11R6.9其实具有相同的源代码(Source Code)。不过X11R7的模块化设计,可提高开发时的容易度。
X11R重要目录
与X11R7有关的软件,大多放在/usr及其子目录中。以下是较为重要的目录的说明:
/usr/bin:存放X Server和不同的X Clients。
/usr/include:开发X Client和图形所需的文件路径。
/usr/lib:X Server和X Clients所需的函数库目录。
/usr/lib/X11:保存多项资源,如字体和文件等。
/usr/lib/xorg/modules:包含驱动程序与多种X Server模块。
/usr/X11/man:保存X11程序编写时的手册说明页。
/etc/X11/xorg.conf文件
在安装时如果没有设置X Window系统,之后必须先行设置鼠标、键盘、显示器以及显示卡等,这样才能成功启用X Window系统,而这些设置都记录在/etc/X11/xorg.conf文件中。这个文件的重要性可见一斑。
这个文件由数个Section/EndSection的区块组成,而每个区块的格式如下:
Section "Section名称"
      选项名称     "选项值"
          选项名称     "选项值"
      选项名称     "选项值"

EndSection
下面将说明/etc/X11/xorg.conf文件中使用的Section类型及每个类型可用的选项名称和选项值。
ServerLayout
“ServerLayout”Section主要用于建立X Server启动时的外观,如果文件中包含多个ServerLayout Section,则默认会使用第一个ServerLayout Section的设置。
以下是此区块的系统默认值,以及可供使用的选项说明:
Section "ServerLayout"
       Identifier                    "Default Layout"
       Screen                      "Default Screen"
       InputDevice             "Generic Keyboard"
       InputDevice             "Configured Mouse"
       InputDevice             "stylus" "SendCoreEvents"
       InputDevice             "cursor" "SendCoreEvents"
       InputDevice             "eraser" "SendCoreEvents"
EndSection
Identifier:此ServerLayout Section的惟一名称。
Screen:“Screen”Section指定的名称,此名称左侧的数字表示在Multi-head环境下的屏幕数量,如果使用标准的Single-head显示卡,则此值为0。在此名称右侧的数字分别代表屏幕左上角的X与Y绝对坐标,默认值为“0 0”。
InputDevice:在X Server中的“InputDevice”Section名称。通常在此仅有两行设置,即Mouse0和Keyboard0,也就是系统中的第一个鼠标和键盘,而其他的设备大多可以忽略。
Files
“Files”Section用于设置X Server服务的路径,如字体和颜色。以下是此区块的系统默认值,以及可供使用的选项说明:
Section "Files"
       FontPath       "/usr/share/X11/fonts/misc"
       FontPath       "/usr/share/X11/fonts/cyrillic"
       FontPath       "/usr/share/X11/fonts/100dpi/:unscaled"
       FontPath       "/usr/share/X11/fonts/75dpi/:unscaled"
       FontPath       "/usr/share/X11/fonts/Type1"
       FontPath       "/usr/share/X11/fonts/100dpi"
       FontPath       "/usr/share/X11/fonts/75dpi"
       FontPath       "/usr/share/fonts/X11/misc"
       # path to defoma fonts
       FontPath       "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection
RgbPath:RGB数据库的路径。这个文件定义在X中所有有效颜色的名称,并且指定数值。
FontPath:设置X Server寻找字体时的路径。可以同时使用多个路径,但需用逗号隔开。
Module
“Module”Section主要用来告诉X Server应加载哪些模块。这些模块可以提供额外的服务功能,一般并不需要更改此处的值。此处使用的惟一选项为“Load”,它可用来加载模块。以下是此区块的系统默认值:
Section "Module"
       Load "i2c"
       Load "bitmap"
       Load "ddc"
       Load "dri"
       Load "extmod"
       Load "freetype"
       Load "glx"
       Load "int10"
       Load "type1"
       Load "vbe"
EndSection
InputDevice
“InputDevice”Section用于设置鼠标或键盘等输入设备,以便通过X Server提供信息给Linux系统,多数系统至少都存在两个InputDevice Section(鼠标和键盘)。
以下是此区块的系统默认值,以及可供使用的选项说明:
Section "InputDevice"
       Identifier       "Generic Keyboard"
       Driver                      "kbd"
       Option          "CoreKeyboard"
       Option          "XkbRules"     "xorg"
       Option          "XkbModel" "pc105"
       Option          "XkbLayout" "us"
       Option          "XkbOptions" "lv3:ralt_switch"
EndSection
Section "InputDevice"
       Identifier       "Configured Mouse"
       Driver                      "mouse"
       Option          "CorePointer"
       Option          "Device"                    "/dev/input/mice"
       Option          "Protocol"                "ExplorerPS/2"
       Option          "ZAxisMapping"                    "4 5"
       Option          "Emulate3Buttons"    "true"
EndSection
Section "InputDevice"
    Driver           "wacom"
    Identifier         "stylus"
    Option            "Device"        "/dev/wacom" # Change to
                                                 # /dev/input/event
                                               # for USB
    Option            "Type"       "stylus"
    Option            "ForceDevice" "ISDV4"       # Tablet PC ONLY
EndSection
Section "InputDevice"
    Driver            "wacom"
    Identifier         "eraser"
    Option            "Device"        "/dev/wacom" # Change to
                                             # /dev/input/event
                                             # for USB
    Option            "Type"       "eraser"
    Option            "ForceDevice" "ISDV4"        # Tablet PC ONLY
EndSection
Section "InputDevice"
    Driver            "wacom"
    Identifier         "cursor"
    Option            "Device"        "/dev/wacom" # Change to
                                                 # /dev/input/event
                                             # for USB
    Option            "Type"       "cursor"
    Option            "ForceDevice" "ISDV4"       # Tablet PC ONLY
EndSection
Identifier:设置设备的名称。通常这些名称后面都会加上一个数字,第一个设备的数字为0。例如,第一个键盘的Identifier为Keyboard0。
Driver:告诉X Server应该从哪里加载驱动程序。
在大多数的InputDevice Section中,尚有为数不等以“Option”为首的选项,并且包含特定的选项值。如果要启用这些选项功能,只要将每行开头的注释符号“#”去除即可。
Monitor
“Monitor”Section用于设置系统使用的显示器类型,设置此处选项时应特别留意,因为不适当的设置可能会给显示器造成损害。
以下是此区块的系统默认值,以及可供使用的选项说明:
Section "Monitor"
    Identifier             "Generic Monitor"
    Option                "DPMS"
    HorizSync             28-51
    VertRefresh           43-60
EndSection
Identifier:显示器的惟一名称。在这些名称后面都会加上一个数字,而第一个显示器的代表数字为0(Monitor0)。
VendorName:显示器制造商名称。
ModelName:显示器类型名称。
HorizSync:与显示器兼容的水平刷新频率范围,其单位为kHz。这个设置值会同时指出是否在此显示器中使用特定的Modeline值。
VertRefresh:与显示器兼容的垂直刷新频率范围,其单位为kHz。这个设置值会同时指出是否在此显示器中使用特定的Modeline值。
Device
“Device”Section用于设置显示卡的信息内容,在此文件中至少需要包含一个以上的Device Section。如果系统中包含多张显示卡,或一张显示卡上有多种设置值,则可以使用多个Device Section设置。
以下是此区块的系统默认值,以及可供使用的选项说明:
Section "Device"
       Identifier                    "VMWare Inc [VMware SVGA II] PCI Display Adapter"
       Driver                      "vmware"
       BusID                      "PCI:0:15:0"
EndSection
Identifier:显示卡的惟一名称。
Driver:用来告诉X Server应从何处加载显示卡的驱动程序。
VendorName:显示卡制造商名称。
BoardName:显示卡类型名称。
BusID:显示卡的总线位置,这个选项适用于多显示卡环境。
Screen
“Screen”Section合并了Device和Monitor的部分,以便能够形成成对的设置内容。在此文件中至少需要包含一个以上的Screen Section。
以下是此区块的系统默认值,以及可供使用的选项说明:
Section "Screen"
    Identifier               "Default Screen"
    Device                  "VMWare Inc [VMware SVGA II] PCI Display Adapter"
    Monitor                  "Generic Monitor"
    DefaultDepth                 24
    SubSection                "Display"
              Depth                   1
          Modes                    "1024×768" "800×600" "640×480"
    EndSubSection
    SubSection                "Display"
          Depth                      4
          Modes          "1024×768" "800×600" "640×480"
    EndSubSection
    SubSection "             Display"
          Depth                      8
          Modes          "1024×768" "800×600" "640×480"
    EndSubSection
    SubSection                       "Display"
          Depth                      15
          Modes          "1024×768" "800×600" "640×480"
    EndSubSection
    SubSection                       "Display"
          Depth                      16
          Modes          "1024×768" "800×600" "640×480"
    EndSubSection
    SubSection                       "Display"
          Depth                      24
          Modes          "1024×768" "800×600" "640×480"
    EndSubSection
EndSection
Identifier:定义一个“Screen”名称,以便在“ServerLayout”Section中进行参照。
Device:指定“Device”Section中的名称。
Monitor:指定“Monitor”Section中的名称。
DefaultDepth:默认的色深(Color Depth)位数。
DRI
Direct Rendering Infrastructure(DRI)是一种接口,它让3D软件可以使用新型显示设备的3D硬件加速功能。除此之外,DRI也能改善2D硬件加速的性能。但通常并不使用这个选项功能,除非在“Module”Section中打开DRI设置。以下是此区块的系统默认值:
Section "DRI"
    Mode     0666
EndSection

 

http://blog.chinaunix.net/u3/93926/showart_1872884.html

原创粉丝点击