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

所属分类: 操作系统 / unix linux 阅读数: 54
收藏 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],也就是系统中的第一个鼠标和键盘,而其他的设备大多可以忽略。

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

vm下centos7 mini版 NAT模式下配置静态IP的方法

这篇文章主要介绍了vm下centos7 mini版 NAT模式下配置静态IP 的方法,本文图文并茂给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

window10系统安装Ubuntu18.04系统的图文教程详解

这篇文章主要介绍了window10系统安装Ubuntu18.04系统,本文图文并茂给大家介绍的非常详细,具有一定的参考借鉴价值 ,需要的朋友可以参考下
收藏 0 赞 0 分享

linux yum安装指定版本mysql的教程详解

这篇文章主要介绍了linux yum安装指定版本mysql的教程,本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

ubuntu系统下Python虚拟环境的安装和使用教程

这篇文章主要介绍了ubuntu系统下Python虚拟环境的安装和使用教程,本文给大家介绍的非常详细,具有一定的参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

在 Ubuntu 上安装 pip的方法

这篇文章主要介绍了在 Ubuntu 上安装 pip的方法,非常不错,具有一定的参考借鉴价值,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

最全的VI命令与快捷键大全集合建议收藏

vi编辑器是所有Unix及Linux系统下标准的编辑器,它的强大不逊色于任何最新的文本编辑器,这里为大家分享VI命令,需要的朋友可以参考下
收藏 0 赞 0 分享

详解Ubuntu18.04下配置Nginx+RTMP+HLS+HTTPFLV服务器实现点播/直播/录制功能

这篇文章主要介绍了Ubuntu18.04下配置Nginx+RTMP+HLS+HTTPFLV服务器实现点播/直播/录制功能,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

Centos7重启apache、nginx、mysql、php-fpm命令方法

这篇文章主要介绍了Centos7重启apache、nginx、mysql、php-fpm命令方法,需要的朋友可以参考下
收藏 0 赞 0 分享

linux 部署apache服务的步骤

这篇文章主要介绍了linux部署apache服务的步骤,部署apache服务的步骤本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下
收藏 0 赞 0 分享

统计Linux 中文件和文件夹/目录的数量(示例代码)

这篇文章主要介绍了统计Linux 中文件和文件夹/目录的数量(示例代码),需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多