X11,xorg.conf配置詳解

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章