先看一個完整的xorg.conf文件,如下:
1:
# /.../
2:
# SaX generated X11 config file
3:
# Created on: 2009-05-31T19:02:32+0800.
4:
#
5:
# Version: 8.1
6:
# Contact: Marcus Schaefer <sax@suse.de>, 2005
7:
# Contact: SaX-User list <https:
//lists.berlios.de/mailman/listinfo/sax-users>
8:
#
9:
# Automatically generated by [ISaX] (8.1)
10:
# PLEASE DO NOT EDIT THIS FILE!
11:
#
12:
Section
"Files"
13:
FontPath
"/usr/share/fonts/misc:unscaled"
14:
FontPath
"/usr/share/fonts/local"
15:
FontPath
"/usr/share/fonts/75dpi:unscaled"
16:
FontPath
"/usr/share/fonts/100dpi:unscaled"
17:
FontPath
"/usr/share/fonts/Type1"
18:
FontPath
"/usr/share/fonts/URW"
19:
FontPath
"/usr/share/fonts/Speedo"
20:
FontPath
"/usr/share/fonts/PEX"
21:
FontPath
"/usr/share/fonts/cyrillic"
22:
FontPath
"/usr/share/fonts/latin2/misc:unscaled"
23:
FontPath
"/usr/share/fonts/latin2/75dpi:unscaled"
24:
FontPath
"/usr/share/fonts/latin2/100dpi:unscaled"
25:
FontPath
"/usr/share/fonts/latin2/Type1"
26:
FontPath
"/usr/share/fonts/latin7/75dpi:unscaled"
27:
FontPath
"/usr/share/fonts/baekmuk:unscaled"
28:
FontPath
"/usr/share/fonts/japanese:unscaled"
29:
FontPath
"/usr/share/fonts/kwintv"
30:
FontPath
"/usr/share/fonts/truetype"
31:
FontPath
"/usr/share/fonts/uni:unscaled"
32:
FontPath
"/usr/share/fonts/CID"
33:
FontPath
"/usr/share/fonts/ucs/misc:unscaled"
34:
FontPath
"/usr/share/fonts/ucs/75dpi:unscaled"
35:
FontPath
"/usr/share/fonts/ucs/100dpi:unscaled"
36:
FontPath
"/usr/share/fonts/hellas/misc:unscaled"
37:
FontPath
"/usr/share/fonts/hellas/75dpi:unscaled"
38:
FontPath
"/usr/share/fonts/hellas/100dpi:unscaled"
39:
FontPath
"/usr/share/fonts/hellas/Type1"
40:
FontPath
"/usr/share/fonts/misc/sgi:unscaled"
41:
FontPath
"/usr/share/fonts/xtest"
42:
FontPath
"/opt/kde3/share/fonts"
43:
FontPath
"unix/:7100"
44:
InputDevices
"/dev/gpmdata"
45:
InputDevices
"/dev/input/mice"
46:
EndSection
47:
Section
"ServerFlags"
48:
Option
"AllowMouseOpenFail"
"on"
49:
EndSection
50:
Section
"Module"
51:
Load
"extmod"
52:
Load
"type1"
53:
Load
"glx"
54:
Load
"freetype"
55:
Load
"dbe"
56:
Load
"v4l"
57:
EndSection
58:
Section
"InputDevice"
59:
Driver
"kbd"
60:
Identifier
"Keyboard[0]"
61:
Option
"Protocol"
"Standard"
62:
Option
"XkbLayout"
"us"
63:
Option
"XkbModel"
"pc104"
64:
Option
"XkbRules"
"xfree86"
65:
EndSection
66:
Section
"InputDevice"
67:
Driver
"mouse"
68:
Identifier
"Mouse[1]"
69:
Option
"Buttons"
"5"
70:
Option
"Device"
"/dev/input/mice"
71:
Option
"Name"
"ImPS/2 Generic Wheel Mouse"
72:
Option
"Protocol"
"explorerps/2"
73:
Option
"Vendor"
"Sysp"
74:
Option
"ZAxisMapping"
"4 5"
75:
EndSection
76:
Section
"Monitor"
77:
DisplaySize 305 230
78:
HorizSync 29-35
79:
Identifier
"Monitor[0]"
80:
ModelName
"800X600@56HZ"
81:
VendorName
"--> VESA"
82:
VertRefresh 50-60
83:
UseModes
"Modes[0]"
84:
EndSection
85:
Section
"Modes"
86:
Identifier
"Modes[0]"
87:
Modeline
"800x600"
35.55 800 832 912 1024 600 601 604 620
88:
Modeline
"768x576"
33.74 768 792 872 976 576 577 580 596
89:
Modeline
"640x480"
23.86 640 656 720 800 480 481 484 497
90:
EndSection
91:
Section
"Screen"
92:
DefaultDepth 16
93:
SubSection
"Display"
94:
Depth 15
95:
Modes
"800x600"
"768x576"
"640x480"
96:
EndSubSection
97:
SubSection
"Display"
98:
Depth 16
99:
Modes
"800x600"
"768x576"
"640x480"
100:
EndSubSection
101:
SubSection
"Display"
102:
Depth 24
103:
Modes
"800x600"
"768x576"
"640x480"
104:
EndSubSection
105:
SubSection
"Display"
106:
Depth 8
107:
Modes
"800x600"
"768x576"
"640x480"
108:
EndSubSection
109:
Device
"Device[0]"
110:
Identifier
"Screen[0]"
111:
Monitor
"Monitor[0]"
112:
EndSection
113:
Section
"Device"
114:
BoardName
"VMWARE0405"
115:
BusID
"0:15:0"
116:
Driver
"vmware"
117:
Identifier
"Device[0]"
118:
Screen 0
119:
VendorName
"VMWare Inc"
120:
EndSection
121:
Section
"ServerLayout"
122:
Identifier
"Layout[all]"
123:
InputDevice
"Keyboard[0]"
"CoreKeyboard"
124:
InputDevice
"Mouse[1]"
"CorePointer"
125:
Option
"Clone"
"off"
126:
Option
"Xinerama"
"off"
127:
Screen
"Screen[0]"
128:
EndSection
129:
Section
"DRI"
130:
Group
"video"
131:
Mode 0660
132:
EndSection
133:
Section
"Extensions"
134:
EndSection
通過上述代碼會發現xorg.conf文件由
Section "xxxx"
.........
EndSection
對組成.下面我們主要解釋一下每個節點的含義。
?
一、輸入設備--鍵盤
1:
Section
"InputDevice"
2:
Driver
"kbd"
3:
Identifier
"Keyboard[0]"
4:
Option
"Protocol"
"Standard"
5:
Option
"XkbLayout"
"us"
6:
Option
"XkbModel"
"pc104"
7:
Option
"XkbRules"
"xfree86"
8:
EndSection
二、輸入設備--鼠標
1:
Section
"InputDevice"
2:
Driver
"mouse"
3:
Identifier
"Mouse[1]"
4:
Option
"Buttons"
"5"
5:
Option
"Device"
"/dev/input/mice"
6:
Option
"Name"
"ImPS/2 Generic Wheel Mouse"
7:
Option
"Protocol"
"explorerps/2"
8:
Option
"Vendor"
"Sysp"
9:
Option
"ZAxisMapping"
"4 5"
10:
EndSection
三、顯示器
1:
Section
"Monitor"
2:
DisplaySize 305 230
3:
HorizSync 29-35
4:
Identifier
"Monitor[0]"
5:
ModelName
"800X600@56HZ"
6:
VendorName
"--> VESA"
7:
VertRefresh 50-60
8:
UseModes
"Modes[0]"
9:
EndSection
其中,
Identifier:顯示器的惟一名稱。在這些名稱后面都會加上一個數字,而第一個顯示器的代表數字為0(Monitor[0])。
VendorName:顯示器制造商名稱。
ModelName:顯示器類型名稱。
HorizSync:與顯示器兼容的水平刷新頻率范圍,其單位為kHz。這個設置值會同時指出是否在此顯示器中使用特定的Modeline值。
?
四、顯卡
1:
Section
"Device"
2:
BoardName
"VMWARE0405"
3:
BusID
"0:15:0"
4:
Driver
"vmware"
5:
Identifier
"Device[0]"
6:
Screen 0
7:
VendorName
"VMWare Inc"
8:
EndSection
?
五、Screen
一個顯示器和一個顯卡組成一個screen,用Section "Screen"描述,如:
?
1:
Section
"Screen"
2:
DefaultDepth 16
3:
SubSection
"Display"
4:
Depth 15
5:
Modes
"800x600"
"768x576"
"640x480"
6:
EndSubSection
7:
SubSection
"Display"
8:
Depth 16
9:
Modes
"800x600"
"768x576"
"640x480"
10:
EndSubSection
11:
SubSection
"Display"
12:
Depth 24
13:
Modes
"800x600"
"768x576"
"640x480"
14:
EndSubSection
15:
SubSection
"Display"
16:
Depth 8
17:
Modes
"800x600"
"768x576"
"640x480"
18:
EndSubSection
19:
Device
"Device[0]"
20:
Identifier
"Screen[0]"
21:
Monitor
"Monitor[0]"
22:
EndSection
其中,
Identifier:定義一個“Screen”名稱,以便在“ServerLayout”Section中進行參照。
Device:指定“Device”Section中的名稱。
Monitor:指定“Monitor”Section中的名稱。
DefaultDepth:默認的色深(Color Depth)位數。
Modes "800x600" "768x576" "640x480" 表示系統會默認先按照800x600的分辨率去適配,如果適配失敗,則選擇768x576的分辨率繼續。
?
六、Modes
1:
Section
"Modes"
2:
Identifier
"Modes[0]"
3:
Modeline
"800x600"
35.55 800 832 912 1024 600 601 604 620
4:
Modeline
"768x576"
33.74 768 792 872 976 576 577 580 596
5:
Modeline
"640x480"
23.86 640 656 720 800 480 481 484 497
6:
EndSection
?
和screen章節中的Modes對應。
?
7、ServerLayout
1:
Section
"ServerLayout"
2:
Identifier
"Layout[all]"
3:
InputDevice
"Keyboard[0]"
"CoreKeyboard"
4:
InputDevice
"Mouse[1]"
"CorePointer"
5:
Option
"Clone"
"off"
6:
Option
"Xinerama"
"off"
7:
Screen
"Screen[0]"
8:
EndSection
ServerLayout”Section主要用于建立X Server啟動時的外觀,其中:
Identifier:此ServerLayout Section的惟一名稱。
Screen:“Screen”Section指定的名稱
InputDevice:在X Server中的“InputDevice”Section名稱。通常在此僅有兩行設置,即Mouse[0]和Keyboard[0],也就是系統中的第一個鼠標和鍵盤,而其他的設備大多可以忽略。
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061
微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元

