Linux系统中xorg.conf文件详细介绍

所属分类: 操作系统 / unix linux 阅读数: 79
收藏 0 赞 0 分享

先看一个完整的xorg.conf文件,如下:

复制代码 代码如下:

# /.../
# SaX generated X11 config file
# Created on: 2009-05-31T19:02:32+0800.
#
# Version: 8.1
# Contact: Marcus Schaefer <sax@suse.de>, 2005
# Contact: SaX-User list <https://lists.berlios.de/mailman/listinfo/sax-users>
#
# Automatically generated by [ISaX] (8.1)
# PLEASE DO NOT EDIT THIS FILE!
#
Section "Files"
  FontPath     "/usr/share/fonts/misc:unscaled"
  FontPath     "/usr/share/fonts/local"
  FontPath     "/usr/share/fonts/75dpi:unscaled"
  FontPath     "/usr/share/fonts/100dpi:unscaled"
  FontPath     "/usr/share/fonts/Type1"
  FontPath     "/usr/share/fonts/URW"
  FontPath     "/usr/share/fonts/Speedo"
  FontPath     "/usr/share/fonts/PEX"
  FontPath     "/usr/share/fonts/cyrillic"
  FontPath     "/usr/share/fonts/latin2/misc:unscaled"
  FontPath     "/usr/share/fonts/latin2/75dpi:unscaled"
  FontPath     "/usr/share/fonts/latin2/100dpi:unscaled"
  FontPath     "/usr/share/fonts/latin2/Type1"
  FontPath     "/usr/share/fonts/latin7/75dpi:unscaled"
  FontPath     "/usr/share/fonts/baekmuk:unscaled"
  FontPath     "/usr/share/fonts/japanese:unscaled"
  FontPath     "/usr/share/fonts/kwintv"
  FontPath     "/usr/share/fonts/truetype"
  FontPath     "/usr/share/fonts/uni:unscaled"
  FontPath     "/usr/share/fonts/CID"
  FontPath     "/usr/share/fonts/ucs/misc:unscaled"
  FontPath     "/usr/share/fonts/ucs/75dpi:unscaled"
  FontPath     "/usr/share/fonts/ucs/100dpi:unscaled"
  FontPath     "/usr/share/fonts/hellas/misc:unscaled"
  FontPath     "/usr/share/fonts/hellas/75dpi:unscaled"
  FontPath     "/usr/share/fonts/hellas/100dpi:unscaled"
  FontPath     "/usr/share/fonts/hellas/Type1"
  FontPath     "/usr/share/fonts/misc/sgi:unscaled"
  FontPath     "/usr/share/fonts/xtest"
  FontPath     "/opt/kde3/share/fonts"
  FontPath     "unix/:7100"
  InputDevices "/dev/gpmdata"
  InputDevices "/dev/input/mice"
EndSection
Section "ServerFlags"
  Option       "AllowMouseOpenFail" "on"
EndSection
Section "Module"
  Load         "extmod"
  Load         "type1"
  Load         "glx"
  Load         "freetype"
  Load         "dbe"
  Load         "v4l"
EndSection
Section "InputDevice"
  Driver       "kbd"
  Identifier   "Keyboard[0]"
  Option       "Protocol" "Standard"
  Option       "XkbLayout" "us"
  Option       "XkbModel" "pc104"
  Option       "XkbRules" "xfree86"
EndSection
Section "InputDevice"
  Driver       "mouse"
  Identifier   "Mouse[1]"
  Option       "Buttons" "5"
  Option       "Device" "/dev/input/mice"
  Option       "Name" "ImPS/2 Generic Wheel Mouse"
  Option       "Protocol" "explorerps/2"
  Option       "Vendor" "Sysp"
  Option       "ZAxisMapping" "4 5"
EndSection
Section "Monitor"
  DisplaySize  305 230
  HorizSync    29-35
  Identifier   "Monitor[0]"
  ModelName    "800X600@56HZ"
  VendorName   "--> VESA"
  VertRefresh  50-60
  UseModes     "Modes[0]"
EndSection
Section "Modes"
  Identifier   "Modes[0]"
  Modeline  "800x600" 35.55 800 832 912 1024 600 601 604 620
  Modeline  "768x576" 33.74 768 792 872 976 576 577 580 596
  Modeline  "640x480" 23.86 640 656 720 800 480 481 484 497
EndSection
Section "Screen"
  DefaultDepth 16
  SubSection "Display"
    Depth      15
    Modes      "800x600" "768x576" "640x480"
  EndSubSection
  SubSection "Display"
    Depth      16
    Modes      "800x600" "768x576" "640x480"
  EndSubSection
  SubSection "Display"
    Depth      24
    Modes      "800x600" "768x576" "640x480"
  EndSubSection
  SubSection "Display"
    Depth      8
    Modes      "800x600" "768x576" "640x480"
  EndSubSection
  Device       "Device[0]"
  Identifier   "Screen[0]"
  Monitor      "Monitor[0]"
EndSection
Section "Device"
  BoardName    "VMWARE0405"
  BusID        "0:15:0"
  Driver       "vmware"
  Identifier   "Device[0]"
  Screen       0
  VendorName   "VMWare Inc"
EndSection
Section "ServerLayout"
  Identifier   "Layout[all]"
  InputDevice  "Keyboard[0]" "CoreKeyboard"
  InputDevice  "Mouse[1]" "CorePointer"
  Option       "Clone" "off"
  Option       "Xinerama" "off"
  Screen       "Screen[0]"
EndSection
Section "DRI"
    Group      "video"
    Mode       0660
EndSection
Section "Extensions"
EndSection

通过上述代码会发现xorg.conf文件由
Section "xxxx"
.........
EndSection

对组成.下面我们主要解释一下每个节点的含义。

一、输入设备--键盘

复制代码 代码如下:

Section "InputDevice"
  Driver       "kbd"
  Identifier   "Keyboard[0]"
  Option       "Protocol" "Standard"
  Option       "XkbLayout" "us"
  Option       "XkbModel" "pc104"
  Option       "XkbRules" "xfree86"
EndSection

二、输入设备--鼠标
复制代码 代码如下:

Section "InputDevice"
  Driver       "mouse"
  Identifier   "Mouse[1]"
  Option       "Buttons" "5"
  Option       "Device" "/dev/input/mice"
  Option       "Name" "ImPS/2 Generic Wheel Mouse"
  Option       "Protocol" "explorerps/2"
  Option       "Vendor" "Sysp"
  Option       "ZAxisMapping" "4 5"
EndSection

三、显示器
复制代码 代码如下:

Section "Monitor"
  DisplaySize  305 230
  HorizSync    29-35
  Identifier   "Monitor[0]"
  ModelName    "800X600@56HZ"
  VendorName   "--> VESA"
  VertRefresh  50-60
  UseModes     "Modes[0]"
EndSection

其中,
Identifier:显示器的惟一名称。在这些名称后面都会加上一个数字,而第一个显示器的代表数字为0(Monitor[0])。

VendorName:显示器制造商名称。

ModelName:显示器类型名称。

HorizSync:与显示器兼容的水平刷新频率范围,其单位为kHz。这个设置值会同时指出是否在此显示器中使用特定的Modeline值。

四、显卡

复制代码 代码如下:

Section "Device"
  BoardName    "VMWARE0405"
  BusID        "0:15:0"
  Driver       "vmware"
  Identifier   "Device[0]"
  Screen       0
  VendorName   "VMWare Inc"
EndSection

五、Screen
一个显示器和一个显卡组成一个screen,用Section "Screen"描述,如:
复制代码 代码如下:

Section "Screen"
  DefaultDepth 16
  SubSection "Display"
    Depth      15
    Modes      "800x600" "768x576" "640x480"
  EndSubSection
  SubSection "Display"
    Depth      16
    Modes      "800x600" "768x576" "640x480"
  EndSubSection
  SubSection "Display"
    Depth      24
    Modes      "800x600" "768x576" "640x480"
  EndSubSection
  SubSection "Display"
    Depth      8
    Modes      "800x600" "768x576" "640x480"
  EndSubSection
  Device       "Device[0]"
  Identifier   "Screen[0]"
  Monitor      "Monitor[0]"
EndSection

其中
 Identifier:定义一个“Screen”名称,以便在“ServerLayout”Section中进行参照。

 Device:指定“Device”Section中的名称。

 Monitor:指定“Monitor”Section中的名称。

 DefaultDepth:默认的色深(Color Depth)位数。

 Modes "800x600" "768x576" "640x480" 表示系统会默认先按照800x600的分辨率去适配,如果适配失败,则选择768x576的分辨率继续。

六、Modes

复制代码 代码如下:

Section "Modes"
  Identifier   "Modes[0]"
  Modeline      "800x600" 35.55 800 832 912 1024 600 601 604 620
  Modeline      "768x576" 33.74 768 792 872 976 576 577 580 596
  Modeline      "640x480" 23.86 640 656 720 800 480 481 484 497
EndSection

和screen章节中的Modes对应。

七、ServerLayout

复制代码 代码如下:

Section "ServerLayout"
  Identifier   "Layout[all]"
  InputDevice  "Keyboard[0]" "CoreKeyboard"
  InputDevice  "Mouse[1]" "CorePointer"
  Option       "Clone" "off"
  Option       "Xinerama" "off"
  Screen       "Screen[0]"
EndSection

ServerLayout”Section主要用于建立X Server启动时的外观,其中:

Identifier:此ServerLayout Section的惟一名称。

Screen:“Screen”Section指定的名称

InputDevice:在X Server中的“InputDevice”Section名称。通常在此仅有两行设置,即Mouse[0]和Keyboard[0],也就是系统中的第一个鼠标和键盘,而其他的设备大多可以忽略。

更多精彩内容其他人还在看

教你隐藏Linux的命令行历史

有的时候你可能不想让一些命令记录你的的命令行历史中,本文整理了多种方法让你可以参考。
收藏 0 赞 0 分享

怎样在Linux上录制你的终端操作及回放

在这次的文章中,我们将简单的了解一下如何在Linux上录制和回放终端会话及以gif格式记录的方法。
收藏 0 赞 0 分享

SUSE Linux登录出现黑屏解决方法

登录linux时出现黑屏的找到这篇解决SUSE的黑屏问题
收藏 0 赞 0 分享

个人学习Linux知识总结第1/4页

个人学习linux经常用到的小知识,方便大家以后查阅
收藏 0 赞 0 分享

Linux 下rename 命令的用法第1/2页

刚学习linux的时候,对文件重命名首先想到的就是rename命令,但是按照在windows下对文件重命名的方式试了N多次都没有反应,在网上一搜索,发现很多人都对rename命令知之甚少,甚至有一部分人说linux下没有rename命令,建议大家用mv命令。鉴于此,于是man r
收藏 0 赞 0 分享

Centos 源

Centos操作说明
收藏 0 赞 0 分享

linux备份文件命令收集

收集一些linux下实现文件备份
收藏 0 赞 0 分享

Linux rdesktop操作系统下远程登录Windows XP桌面

众所周知XP下有"远程桌面连接"用来远程登录桌面,设置也非常简单。那有没有什么办法在linux下远程登录到XP呢?有。用rdesktop这个linux下的软件就能实现。
收藏 0 赞 0 分享

Linux操作系统添加新硬盘方法

linux下添加硬盘的方法
收藏 0 赞 0 分享

CentOS 5.1 4.6最新官方下载地址列表

最近公司接触到centos系统,于是找了下,不太容易找到,所以我直接把官方的下载地址,给贴出来了,方便以后下载
收藏 0 赞 0 分享
查看更多