xorg的小工具

来源:互联网 发布:劳动法律师知乎 编辑:程序博客网 时间:2024/04/28 18:46

xorg的小工具

8/22/2009 12:25:11 AM

1、gtf工具来自哪个软件包。

gtf 是来自软件包 xorg-x11,一般的情况下,如果您安装了桌面环境,就有这个工具。系统大多是默认安装的。

2、什么是gtf 。

gtf - calculate VESA GTF mode lines 中文的意思是计算显示设备VESA驱动GTF模式命令行工具。

什么是gtf?gtf(generalized timing formula),一般程序时间,定义了产生画面所需要的时间,包括了诸如画面刷新率等),另外gtf也是显示设备的一个工业标准。通过GTF则可以自动调节屏幕尺寸。

我们通过gtf 工具计算显示器屏幕尺寸、分辨率,然后我们把计算出来的值插入到 xorg.conf配置文件中,就能达到自动调节屏幕的显示尺寸、位置 及分辨率。

3、gtf的用法。

gtf h-resolution v-resolution refresh [-v|--verbose] [-f|--fbmode] [-x|--xorgmode]

举例:我的显示器支持1024x768 ,能达到85HZ,在X模式下。

[beinan@localhost ~]# /usr/X11R6/bin/gtf 1024 768 85 -x  # 1024x768 @ 85.00 Hz (GTF) hsync: 68.60 kHz; pclk: 94.39 MHz  Modeline "1024x768_85.00"   94.39 1024 1088 1200 1376 768 769 772 807 -HSync +Vsync

把上面的输出的信息中Modeline一行,插入到/etc/X11/xorg.conf配置文件中的显示器(Monitor)配置那段中。加入后类似。

Section "Monitor"        Identifier "Monitor0"        VendorName "Monitor Vendor"        ModelName "LCD Panel 1280x1024"        HorizSync 31.5 - 67.0        VertRefresh 50.0 - 75.0        Option "dpms"        Modeline "1024x768_85.00"         94.39 1024 1088 1200 1376 768 769 772 807         -HSync +Vsync        EndSection

改动后,重启X。重新进入桌面模式。

4、 xdpyinfo工具。

我们通过gtf 工具调整了显示器的属性,我们通过观察一般就知道是不是可行了。比如屏幕不闪动的过于厉害。显示区域处于显示屏正中等。但我们还有一个测试工具xdpyinfo 来测试我们的调整 。

xdpyinfo - display information utility for X (用于X的显示信息测试工具)。[beinan@localhost ~]$ /usr/X11R6/bin/xdpyinfo

通过这个输出,我们能查看到很多信息,最重要的有如下一段。

default screen number: 0number of screens: 1screen #0:dimensions: 1024x768 pixels (302x232 millimeters)resolution: 86x84 dots per inchdepths (7): 24, 1, 4, 8, 15, 16, 32root window id: 0x3fdepth of root window: 24 planes

我们可以在 xorg.conf中定义多个显示屏幕,比如 1024x768;800x600等。显示屏的定义的标识符号序列从0开始,以此类推。其实定义好一个就足够用。默认的一般就行。如果我们自己调整,把1024x768类似的加入到screen 中色深为24那段的 Modes 行中。然后把默认色深设置为24就好。

Section "Screen"        Identifier "Screen0"        Device "Videocard0"        Monitor "Monitor0"        DefaultDepth 24        SubSection "Display"                Viewport 0 0                Depth 16                Modes "800x600" "640x480"        EndSubSection        SubSection "Display"                Viewport 0 0                Depth 24                Modes "1280x1024" "1152x864" "1152x768"                 "1024x768" "800x600" "640x480"         EndSubSection         EndSection

其实上面的一段,我们足可以把色深为16的那段删除或者下面的一段每行前面加#号注掉。因为我们用的是 24的。

SubSection "Display"          Viewport 0 0          Depth 16          Modes "800x600" "640x480"          EndSubSection

如果我们只有把 DefaultDepth 24 中的24改为16时,这段才起作用。

原创粉丝点击