本文詳細說明如何透過手動編輯 XF86Config 設定檔調整解析度、色彩深度、掃描頻率,以及利用符號連結切換 X Server 驅動程式。適合需精細調整圖形介面的進階使用者。
X Window 採用 Client/Server 架構,分四層:
/usr/X11R6/bin/XF86_*。系統透過 /usr/X11R6/bin/X 符號連結指向實際驅動程式。切換驅動只需修改此連結:
ln -sf /usr/X11R6/bin/XF86_SVGA /usr/X11R6/bin/X
設定檔通常位於 /usr/X11R6/lib/X11/XF86Config,/etc/X11 有符號連結指向它。採用 Section/Subsection 結構,共九大區段:
RgbPath "/usr/X11R6/lib/X11/rgb" FontPath "/usr/X11R6/lib/X11/fonts/misc" FontPath "/usr/X11R6/lib/X11/fonts/TTF" FontPath "unix/:-1" # Font Server FontPath "tcp/DarkEagle:7100" # 遠端 Font Server
新增字型目錄後需執行 mkfontdir 產生 fonts.dir 索引檔。
Section "Monitor"
Identifier "MyMonitor"
HorizSync 30-70
VertRefresh 50-120
ModeLine "1024x768" 71.4 1024 1040 1216 1408 768 769 772 800
EndSection
ModeLine 參數:名稱、點頻、水平時序四值、垂直時序四值。可用 gtf 工具計算。
Section "Device"
Identifier "MyCard"
Driver "svga"
VideoRam 4096
Option "DacSpeed" "110"
EndSection
Section "Screen"
Driver "svga"
Device "MyCard"
Monitor "MyMonitor"
Subsection "Display"
Depth 16
Modes "1024x768" "800x600" "640x480"
EndSubsection
EndSection
Depth 對應色彩深度(8=256色、16=65536色、24=1670萬色)。Modes 依優先序嘗試。
Xconfigurator、XF86Setup(需 XF86_VGA16 驅動)。X 連結指向 XF86_VGA16 進入 16 色模式修復。