?? 第四章.htm
字號:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<title>第四章</title>
<meta name="GENERATOR" content="eTextWizard V 1.98 Build 550">
<style>
<!--
body { line-height: 20px}
td { line-height: 20px}
.Paragraph{ font-size: 9pt }
.9{ font-size: 9pt }
A:link {text-decoration: none; color:#0033CC}
A:visited {text-decoration: none; color: #0033CC}
A:active {text-decoration: none; color: #0000ff }
A:hover {text-decoration: underline; color: #FF0000 }
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<div align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" width="80%">
<tr>
<td width="80%" bgcolor="#000000">
<table border="0" cellspacing="1" width="100%" cellpadding="6" height="98">
<tr>
<td width="100%" bgcolor="#FFFFFD" height="20">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%"><p align="right" class="9"><a href="第三章.htm">上一頁</a> <a href="目錄.htm">目錄</a> <a href="第五章.htm">下一頁</a> </td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#FFCC00">
<td width="100%" height="21">
<p align="center"><strong>第四章</strong>
</td>
</tr>
<tr bgcolor="#FFF5D0">
<td width="100%" height="51" align=center>
<table><tr><td><p class="Paragraph"><br>
第四章 X的配置
<br>
<br>雖然文章寫得不好,但是我還是希望我的文章為公社的朋友提供幫助,和以前一樣的,這個系列教程的文章我只在公社發表,希望大家捧場。
<br>
<br>我的文章耽誤了很久了,很抱歉。前段時間因為我一直忙著找工作,又生病一場,所以文章的事情一推再推,現在終于可以奉獻給大家了。
<br>
<br>這一章我主要介紹X系統用的主要配置文件XF86Config-4,我采用了對照的方法介紹,一邊貼出我的XF86Config-4文件,一邊介紹具體的內容。這篇文章對于大家沒有什么立桿見影的幫助,不果可以讓你對于X的只是有一個基本的了解。
<br>
<br>XF86Config-4文件是X系統的主要配置文件。在Redhat 8以前版本中都叫做XF86Config-4這個名字,Redhat 8已經不再叫做這個名字。
<br>
<br>編輯這個文件需要小心謹慎一點,因為一點錯誤,你的X將不能啟動。不果沒關系啦,改回來就是了學習Linux最好的辦法當然還是求助于男人(man),大家有什么問題盡管看看man的幫助就是了。如果你要刪除文件中的內容,最好不要直接的刪除,而應該在前面加上#符號把它變成注釋。
<br>
<br>在Redhat 8以前的版本中,X的配置工具是Xconfigurator,在Debian中X的配種方法是:
<br>dpkg-reconfigure xserver-xfree86
<br>當然你都得用root的身份來運行。
<br>
<br>在/usr/share/doc/xfree86-common/FAQ.gz文件中你可以看到具體的技巧。
<br>
<br>
<br>第一段是Files段,這個部分用來配置X系統說能夠使用的字體,每一行都代表一個目錄,保存了具體的字體和字體的配置信息。
<br>代碼:
<br>
<br>Section "Files"
<br> FontPath "/usr/X11R6/lib/X11/fonts/xp"
<br> FontPath "/usr/X11R6/lib/X11/fonts/XChinese"
<br> FontPath "unix/:7100" # 這是本地字體服務器
<br> # 如果本地字體服務器出了問題,我們可以使用下面的配置
<br> FontPath "/usr/lib/X11/fonts/misc"
<br> FontPath "/usr/lib/X11/fonts/cyrillic"
<br> FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
<br> FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
<br> FontPath "/usr/lib/X11/fonts/Type1"
<br> FontPath "/usr/lib/X11/fonts/Speedo"
<br> FontPath "/usr/lib/X11/fonts/100dpi" #這兩個字體是每一個X
<br> FontPath "/usr/lib/X11/fonts/75dpi" #系統都必需安裝的英文字體
<br>EndSection
<br>
<br>
<br>下面的是模塊段,用來配置X系統加載的模塊。
<br>代碼:
<br>
<br>Section "Module"
<br> Load "xtt" #gtk1使用的字體引擎,效果好,速度稍慢
<br> Load "GLcore" #如果你是用的是Nvidia的顯卡,似乎一定要注消掉這一行
<br> Load "bitmap"
<br> Load "dbe"
<br> Load "ddc"
<br> Load "dri"
<br> Load "extmod"
<br># Load "freetype" #如果你使用了xtt模塊,那么freetype模塊就需要注消掉
<br> Load "glx"
<br> Load "int10"
<br> Load "record"
<br> Load "speedo"
<br> Load "type1"
<br> Load "vbe"
<br>EndSection
<br>
<br>
<br>下面的段是用來配置你的鍵盤的,屬于“輸入設備”
<br>代碼:
<br>
<br>Section "InputDevice"
<br> Identifier "Generic Keyboard" #這是你的鍵盤的名字,隨便你啦:)
<br> Driver "keyboard" #鍵盤的驅動…哇,鍵盤也有驅動
<br> Option "CoreKeyboard" #如果你有多個鍵盤,那么你需要在這里指定哪一個鍵盤是主要的鍵盤
<br> Option "XkbRules" "xfree86"
<br> Option "XkbModel" "pc104" #鍵盤的分布格式,一般來說
<br> Option "XkbLayout" "us" #美國104鍵盤是大家通用的。
<br>EndSection
<br>
<br>
<br>這里配置你的鼠標,當然你可以配置兩個鼠標,如果你有的話
<br>代碼:
<br>
<br>Section "InputDevice"
<br> Identifier "Configured Mouse" #鼠標的名字
<br> Driver "mouse" #鼠標的驅動
<br> Option "CorePointer"
<br> Option "Device" "/dev/input/mice"
<br> #注意,這里很重要,這是鼠標的設備文件
<br> #我的鼠標是光電鼠標,用的USB接口,對應的鼠標文件是/dev/input/mice
<br> #如果你的鼠標是普通的滾輪鼠標,用的是PS2接口,那么你應該使用
<br> #/dev/mouse或者/dev/psaux或者/dev/ttys0這個設備
<br> Option "Protocol" "ImPS/2"
<br> #這是鼠標的類型,如果不是是滾輪鼠標,那么使用PS/2
<br> Option "Emulate3Buttons" "true"
<br> #在Linux系統中,鼠標的第三個鍵非常有用,
<br> #如果你的鼠標沒有第三個鍵,那么我們應該允許使用雙鍵同時點擊來模擬
<br> Option "ZAxisMapping" "4 5"
<br>EndSection
<br>
<br>
<br>下面的設備是顯卡,這是最頭痛的設備了,如果你的顯卡太新潮,很有可能不能支持哦。Nvidia的GForce2顯卡就必需自己編譯顯卡的驅動程序才能使用
<br>代碼:
<br>
<br>Section "Device"
<br> Identifier "Generic Video Card"
<br> Driver "ati" #如果你是Nivida的顯卡,這里應該是"nvidia"
<br>EndSection
<br>
<br>
<br>
<br>這個設備是顯示器。
<br>代碼:
<br>
<br>Section "Monitor"
<br> Identifier "Generic Monitor" #顯示器的名字
<br> HorizSync 30-60 #顯示器的頻率,一半來說你的顯示器
<br> VertRefresh 50-75 #應該可以達到我的這個水平
<br> #因為我的顯示器是15"的老顯示器了
<br> #大家的電腦都比我的好吧?
<br> Option "DPMS"
<br>EndSection
<br>
<br>
<br>下面是綜合以上你的配置的設備的各種顯示效果
<br>代碼:
<br>
<br>Section "Screen"
<br> Identifier "Default Screen" #效果的名字
<br> Device "Generic Video Card" #你可以指定你的顯卡的名字
<br> Monitor "Generic Monitor" #指定你的顯示器的名字
<br> DefaultDepth 24 #默認的顏色深度
<br> SubSection "Display"
<br> Depth 1
<br> Modes "1024x768"
<br> EndSubSection
<br> SubSection "Display"
<br> Depth 4
<br> Modes "1024x768"
<br> EndSubSection
<br> SubSection "Display"
<br> Depth 8
<br> Modes "1024x768"
<br> EndSubSection
<br> SubSection "Display"
<br> Depth 16
<br> Modes "1024x768" #在這里你可以指定掃描頻率例如
<br> #"1024x768 @ 85"就是用85mhz的頻率
<br> EndSubSection
<br> SubSection "Display"
<br> Depth 24
<br> Modes "1024x768"
<br> EndSubSection
<br>EndSection
<br>
<br>
<br>
<br>最終你必需定義下面的段用來告訴X服務器你使用的配置
<br>代碼:
<br>
<br>Section "ServerLayout"
<br> Identifier "Default Layout" #剛才我們給我們的配置取的名字
<br> Screen "Default Screen" #給我們的效果取的名字
<br> InputDevice "Generic Keyboard" #我們的鍵盤的名字
<br> InputDevice "Configured Mouse" #我們的鼠標的名字
<br> #這些名字一定要在前面的配置中已經定義
<br>EndSection
<br>
<br>Section "DRI"
<br> Mode 0666
<br>EndSection
<br>
<br>
<br>
<br>一般來說我們X啟動時候會遇到的問題是:
<br>1:no screen found
<br>這有可能是你沒有正確的定義所需要的效果,也有可能是你的其他部分定義出錯倒置你的效果不能實現
<br>2:xtt和freetype的沖突,注消一個就可以了
<br>3:驅動沒有找到,如果你的顯卡非常的新潮,那么多半是這個錯誤了,編譯你的驅動吧…
<br>
<br> <br></p></td></tr></table></td>
</tr>
<tr>
<td width="100%" bgcolor="#FFFFFD" height="20"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%"><p align="right" class="9"><a href="第三章.htm">上一頁</a> <a href="目錄.htm">目錄</a> <a href="第五章.htm">下一頁</a> </td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center></div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -