ubuntu系统下配置X Server的方法(非xorg.conf文件..

不知从ubuntu的那个系统版本开始,使用的xorg系统的配置文件不再使用/etc/X11/xorg.conf文件. 但具体改为什么文件来配置X Server不清楚. 网上google了一下国内外的网站, 只有几个国外的ubuntu相关网站对此问题有所涉及, 具体方法还是恢复使用/etc/X11/xorg.conf.

本人想把系统颜色由24位(ubuntu系统默认的真彩色)改为16位. 这样做为了加快系统运行速度并增加电池续航能力. 但又不想用xorg.conf文件. 因为既然系统默认不用,我想肯定改为其他方法. 于是想一探究竟.

网上搜索无果后, 就想在系统里面找找. 首先 用命令 locate xorg 在系统内部文件系统里找了一下. 出来很多信息, 没有耐心去一页一页的找. 于是, 就去/var/log/Xorg.0.log这个日志文件中看看.
在里面查找xorg,结果发现这样一行信息:
Using config directory: "/usr/lib/X11/xorg.conf.d"
原来, xorg改用"/usr/lib/X11/xorg.conf.d"这个目录存放配置文件. 里面有下面几个文件:
05-evdev.conf  10-synaptics.conf  10-vmmouse.conf  10-wacom.conf  20-thinkpad.conf
打开其中的20-thinkpad.conf:
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TrackPoint"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
这个有点眼熟, 就是原来xorg.conf中用于配置输入设备的一个section. 文件名命名方法类似/etc/rc2.d中启动脚本的命名方法.

因为我想改color depth. 而它涉及section "Screen"的配置,所以就写个配置文件00-screen.conf:
Section "Device"
    Identifier    "Configured Video Device"
EndSection

Section "Monitor"
    Identifier    "Configured Monitor"
    Option        "DPMS"
EndSection

Section "Screen"
    Identifier    "Default Screen"
    Monitor        "Configured Monitor"
    Device        "Configured Video Device"
    DefaultDepth     16
    Option         "TwinView" "1"
        Option         "TwinViewXineramaInfoOrder" "DFP"
        Option         "metamodes" "CRT: 1024x768 +0+0, DFP: 1024x768 +0+0"
       SubSection "Display"
               Depth           16
               Modes           "1024x768" "1680x1050"
        virtual        2704 1050
       EndSubSection
EndSection

这样就把色深改为16了. 系统运行速度和电池使用时间均有明显增加.

作者: dongtao   发布时间: 2010-11-29