红联Linux门户
Linux帮助

xorg.conf是怎么生成的

发布时间:2009-05-11 13:18:31来源:红联作者:wdnyz_yf
如题。还有如果我向电脑插入一个usb键盘,xorg.conf是如何被修改的
文章评论

共有 10 条评论

  1. hantu 于 2009-05-11 23:48:48发表:

    xorg.conf 是xorg图形系统就自己带有的配置文件,你可以手动修改它也可以使用一些配置工具(比如fedora的system-config-display、ubuntu的displayconfig-gtk、slax的xconf等)来生成它。

    U盘的自动挂载不是由xorg完成,而是由桌面环境比如gnome或KDE等完成的,自动挂载时不会使xorg.conf有任何变化。

  2. marco.chan 于 2009-05-11 20:56:14发表:

    man xorg,里面有所有的参数,每次修改什么就去查。
    如果要把这个xorg.conf完全说清楚,估计可以出本几百页的书!

  3. 相思爱文 于 2009-05-11 20:22:27发表:

    装一次gentoo,就全知道了。

  4. wdnyz_yf 于 2009-05-11 19:57:37发表:

    我的不是nv显卡,叫psb,不知道什么显卡,是测试机

  5. 微宝贝 于 2009-05-11 19:40:03发表:

    我也一直比较懒,一直就是NV自动生成的,那里不好再自己修改

  6. wdnyz_yf 于 2009-05-11 19:35:49发表:

    多谢各位的支持,我自己试验了下,在fedora下可以用[code]Xorg -configure[/code]生成一个新的xorg.conf.new文件

  7. wangfeng819 于 2009-05-11 18:29:16发表:

    /etc/X11/xorg.conf文件

    在安装时如果没有设置X Window系统,之后必须先行设置鼠标、键盘、显示器以及显示卡等,这样才能成功启用X Window系统,而这些设置都记录在/etc/X11/xorg.conf文件中。这个文件的重要性可见一斑。

    这个文件由数个Section/EndSection的区块组成,而每个区块的格式如下:

    Section "Section名称"

    选项名称 "选项值"

    选项名称 "选项值"

    选项名称 "选项值"



    EndSection

    下面将说明/etc/X11/xorg.conf文件中使用的Section类型及每个类型可用的选项名称和选项值。
    ServerLayout

    “ServerLayout”Section主要用于建立X Server启动时的外观,如果文件中包含多个ServerLayout Section,则默认会使用第一个ServerLayout Section的设置。

    以下是此区块的系统默认值,以及可供使用的选项说明:

    Section "ServerLayout"

    Identifier "Default Layout"

    Screen "Default Screen"

    InputDevice "Generic Keyboard"

    InputDevice "Configured Mouse"

    InputDevice "stylus" "SendCoreEvents"

    InputDevice "cursor" "SendCoreEvents"

    InputDevice "eraser" "SendCoreEvents"

    EndSection

    Identifier:此ServerLayout Section的惟一名称。

    Screen:“Screen”Section指定的名称,此名称左侧的数字表示在Multi-head环境下的屏幕数量,如果使用标准的Single-head显示卡,则此值为0。在此名称右侧的数字分别代表屏幕左上角的X与Y绝对坐标,默认值为“0 0”。

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

    “Files”Section用于设置X Server服务的路径,如字体和颜色。以下是此区块的系统默认值,以及可供使用的选项说明:

    Section "Files"

    FontPath "/usr/share/X11/fonts/misc"

    FontPath "/usr/share/X11/fonts/cyrillic"

    FontPath "/usr/share/X11/fonts/100dpi/:unscaled"

    FontPath "/usr/share/X11/fonts/75dpi/:unscaled"

    FontPath "/usr/share/X11/fonts/Type1"

    FontPath "/usr/share/X11/fonts/100dpi"

    FontPath "/usr/share/X11/fonts/75dpi"

    FontPath "/usr/share/fonts/X11/misc"

    # path to defoma fonts

    FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"

    EndSection

    RgbPath:RGB数据库的路径。这个文件定义在X中所有有效颜色的名称,并且指定数值。

    FontPath:设置X Server寻找字体时的路径。可以同时使用多个路径,但需用逗号隔开。
    Module

    “Module”Section主要用来告诉X Server应加载哪些模块。这些模块可以提供额外的服务功能,一般并不需要更改此处的值。此处使用的惟一选项为“Load”,它可用来加载模块。以下是此区块的系统默认值:

    Section "Module"

    Load "i2c"

    Load "bitmap"

    Load "ddc"

    Load "dri"

    Load "extmod"

    Load "freetype"

    Load "glx"

    Load "int10"

    Load "type1"

    Load "vbe"

    EndSection
    InputDevice

    “InputDevice”Section用于设置鼠标或键盘等输入设备,以便通过X Server提供信息给Linux系统,多数系统至少都存在两个InputDevice Section(鼠标和键盘)。

    以下是此区块的系统默认值,以及可供使用的选项说明:

    Section "InputDevice"

    Identifier "Generic Keyboard"

    Driver "kbd"

    Option "CoreKeyboard"

    Option "XkbRules" "xorg"

    Option "XkbModel" "pc105"

    Option "XkbLayout" "us"

    Option "XkbOptions" "lv3:ralt_switch"

    EndSection

    Section "InputDevice"

    Identifier "Configured Mouse"

    Driver "mouse"

    Option "CorePointer"

    Option "Device" "/dev/input/mice"

    Option "Protocol" "ExplorerPS/2"

    Option "ZAxisMapping" "4 5"

    Option "Emulate3Buttons" "true"

    EndSection

    Section "InputDevice"

    Driver "wacom"

    Identifier "stylus"

    Option "Device" "/dev/wacom" # Change to

    # /dev/input/event

    # for USB

    Option "Type" "stylus"

    Option "ForceDevice" "ISDV4" # Tablet PC ONLY

    EndSection

    Section "InputDevice"

    Driver "wacom"

    Identifier "eraser"

    Option "Device" "/dev/wacom" # Change to

    # /dev/input/event

    # for USB

    Option "Type" "eraser"

    Option "ForceDevice" "ISDV4" # Tablet PC ONLY

    EndSection

    Section "InputDevice"

    Driver "wacom"

    Identifier "cursor"

    Option "Device" "/dev/wacom" # Change to

    # /dev/input/event

    # for USB

    Option "Type" "cursor"

    Option "ForceDevice" "ISDV4" # Tablet PC ONLY

    EndSection

    Identifier:设置设备的名称。通常这些名称后面都会加上一个数字,第一个设备的数字为0。例如,第一个键盘的Identifier为Keyboard0。

    Driver:告诉X Server应该从哪里加载驱动程序。

    在大多数的InputDevice Section中,尚有为数不等以“Option”为首的选项,并且包含特定的选项值。如果要启用这些选项功能,只要将每行开头的注释符号“#”去除即可。
    Monitor

    “Monitor”Section用于设置系统使用的显示器类型,设置此处选项时应特别留意,因为不适当的设置可能会给显示器造成损害。

    以下是此区块的系统默认值,以及可供使用的选项说明:

    Section "Monitor"

    Identifier "Generic Monitor"

    Option "DPMS"

    HorizSync 28-51

    VertRefresh 43-60

    EndSection

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

    VendorName:显示器制造商名称。

    ModelName:显示器类型名称。

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

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

    “Device”Section用于设置显示卡的信息内容,在此文件中至少需要包含一个以上的Device Section。如果系统中包含多张显示卡,或一张显示卡上有多种设置值,则可以使用多个Device Section设置。

    以下是此区块的系统默认值,以及可供使用的选项说明:

    Section "Device"

    Identifier "VMWare Inc [VMware SVGA II] PCI Display Adapter"

    Driver "vmware"

    BusID "PCI:0:15:0"

    EndSection

    Identifier:显示卡的惟一名称。

    Driver:用来告诉X Server应从何处加载显示卡的驱动程序。

    VendorName:显示卡制造商名称。

    BoardName:显示卡类型名称。

    BusID:显示卡的总线位置,这个选项适用于多显示卡环境。
    Screen

    “Screen”Section合并了Device和Monitor的部分,以便能够形成成对的设置内容。在此文件中至少需要包含一个以上的Screen Section。

    以下是此区块的系统默认值,以及可供使用的选项说明:

    Section "Screen"

    Identifier "Default Screen"

    Device "VMWare Inc [VMware SVGA II] PCI Display Adapter"

    Monitor "Generic Monitor"

    DefaultDepth 24

    SubSection "Display"

    Depth 1

    Modes "1024×768" "800×600" "640×480"

    EndSubSection

    SubSection "Display"

    Depth 4

    Modes "1024×768" "800×600" "640×480"

    EndSubSection

    SubSection " Display"

    Depth 8

    Modes "1024×768" "800×600" "640×480"

    EndSubSection

    SubSection "Display"

    Depth 15

    Modes "1024×768" "800×600" "640×480"

    EndSubSection

    SubSection "Display"

    Depth 16

    Modes "1024×768" "800×600" "640×480"

    EndSubSection

    SubSection "Display"

    Depth 24

    Modes "1024×768" "800×600" "640×480"

    EndSubSection

    EndSection

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

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

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

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

    Direct Rendering Infrastructure(DRI)是一种接口,它让3D软件可以使用新型显示设备的3D硬件加速功能。除此之外,DRI也能改善2D硬件加速的性能。但通常并不使用这个选项功能,除非在“Module”Section中打开DRI设置。以下是此区块的系统默认值:

    Section "DRI"

    Mode 0666

    EndSection

  8. 相思爱文 于 2009-05-11 14:22:24发表:

    xorg.conf可以用命令半自动修改。还是手动修改方便。
    配置命令不同版本可能会有不同。

  9. wang7131984 于 2009-05-11 13:52:20发表:

    xorg.conf难点啊,我到现在也没搞清楚怎么配这个东西,主要是太懒......其实你可以去网上抄一个。好像我的系统里以前也没有这个东西。

  10. 相思爱文 于 2009-05-11 13:35:19发表:

    查看xorg.conf,上面注释掉的地方说明用什么命令建立。
    我插入usb键盘直接就能用了。