f5b 发表于 2013-11-20 12:14

X11如何设置最佳分辨率

本帖最后由 f5b 于 2013-11-25 15:21 编辑

只有>>>
# startx 进入X图形界面之后,看起来不是显示器默认最佳分辨率
# xrandr X界面下输入此命令看到的默认值也不是最佳分辨率

才需要以下操作

仔细看http://www.openbsd.org/faq/faq11.html

特别是“如何退出X”,首选CTRL-ALT-Backspace,也要保留ssh服务开放登陆
This might be a really good time to talk about ways of exiting X when started in this way. In order of preference:

    CTRL-ALT-Backspace: This hopefully causes X to immediately terminate, along with all X applications that are running. Of course, during the configuration process, you don't have any applications running, so this is not a problem (and in fact, at this point, this is your best way to exit X).
    SSH into the box, and "pkill Xorg", which may kill the X process, and may return you to a usable console.
    SSH into the box and reboot it.
    Reset or power button. Sometimes things go really bad. Yes, it is usually good to get X running before you load critical applications on the system. Sometimes, a bad X configuration will hang the entire machine to the point that only a hard reset will resolve the problem.

Fortunately for us, CTRL-ALT-Backspace does the job here, and we are returned to a command prompt. So now we need to see if we can figure out what is wrong. First, we should look at what Xorg thinks is going on, and that is recorded in the file /var/log/Xorg.0.log. In this case, it appears that X thinks all is running fine, there are no obviously significant errors shown in the log (lines that start with an "(EE)" are errors).


个人总结


1. 生成基本的xorg.conf.new文件

# X -configure

文件自动生成在 /root/xorg.conf.new

测试xorg.conf.new

# X -config xorg.conf.new   ## 确定鼠标可以移动,CTRL-ALT-Backspace退出X


2. 设置显示器的最佳分辨率

生成最佳分辨率参数
# gtf 1600 1200 60       ###指定目标分辨率和刷新率,注意空格

# 1600x1200 @ 60.00 Hz (GTF) hsync: 74.52 kHz; pclk: 160.96 MHz
Modeline "1600x1200_60.00"160.961600 1704 1880 21601200 1201 1204 1242-HSync +Vsync

编辑xorg.conf.new,
把 “Modeline …… ”整行添加到 Section "Monitor"



再测试xorg.conf.new

# X -config xorg.conf.new   ## 确定鼠标还可以移动,CTRL-ALT-Backspace退出X



# cp /root/xorg.conf.new /etc/X11/xorg.conf


# startx


这样显示器就不需要依赖于任何桌面软件的设置就能以最佳分辨率正常显示了

zhaopingzi 发表于 2013-11-20 16:39

不错咯      

Neolkc 发表于 2013-11-20 18:47

顺便贴上FreeBSD 改变控制台的分辨率的方法:

将下面两行加入内核配制文件中,重新建立新内核!
options    VESA         
options    SC_PIXEL_MODE   

# vidcontrol -imode 查看所支持的模式然后用:
# vidcontrolMODE_模式编号    如: MODE_280

# vidcontrol -g 100x37 VESA_800x600
或在/etc/rc.conf中加入allscreens_flags="-g 100x37 VESA_800x600"
启动的时候就可以变成800x600了。

zeissoctopus 发表于 2013-11-22 17:18

多謝分享!

lbseraph 发表于 2013-11-23 17:00

谢谢分享,收藏学习~
页: [1]
查看完整版本: X11如何设置最佳分辨率