您的位置:首页 > 运维架构 > Linux

linux怎样在命令行模式修改屏幕分辨率

2011-12-28 17:20 513 查看
1:首先 ctrl + alt + F1 进入控制台引导界面

2:选择 kernel /boot/vmlinuz 这一行,然后按 e键

3:进入编辑模式后,在最后面空格后添加 single然后回车

4:按 b 键启动 进入命令行启动模式

执行如下命令:

# Xorg -configure

  这会在 /root 中生成一个叫做 xorg.conf.new 的配置文件 (无论您使用 su(1) 或直接登录,都会改变默认的 $HOME 目录变量)。 X11 程序将尝试探测系统中的图形硬件,并将探测到的硬件信息写入配置文件,以便加载正确的驱动程序。

  下一步是测试现存的配置文件, 以确认 Xorg 能够同系统上的图形设备正常工作。 要完成这个任务,只需:

# Xorg -config xorg.conf.new

  如果用户看到一个黑灰的格子和一个 X 形的鼠标指针,那么配置就是成功的。 要退出测试,只要同时按下 Ctrl+Alt+Backspace。

不成功 如下

我一般就不测试直接上gonme2

xorg.conf.new 内容修改两处 涉及显示器参数

很容易 这句话 要理解 Xorg 能够自动地通过 I2C/DDC 信息来自动获取宽屏显示器的分辨率信息, 并处理显示器支持的频率和分辨率。

看我的 参数

默认Xorg -configure xorg.conf.new 参数

只看两段 也就修改这两段

显示器 硬件参数

Section "Monitor"

#DisplaySize 320 240 # mm

Identifier "Monitor0"

VendorName "LEN"

ModelName "LXB-HF769A"

### Comment all HorizSync and VertRefresh values to use DDC:

HorizSync 30.0 - 70.0 这里要注意阿液晶显示器也有此项参数如果没有的话显示分辩率不正常

VertRefresh 50.0 - 160.0

Option "DPMS"

EndSection

默认启动桌面 分辨率参数

Section "Screen"

Identifier "Screen0"

Device "Card0"

Monitor "Monitor0"

SubSection "Display"

Viewport 0 0

Depth 1

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 4

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 8

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 15

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 16

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 24

EndSubSection

EndSection

第一部分修改 注意看

Section "Monitor"

Identifier "Monitor0"

VendorName "LEN"

ModelName "LXB-HF769A"

HorizSync 30.0 - 70.0

VertRefresh 50.0 - 160.0

Option "DPMS"

EndSection

把注解的说明去掉用显示器默认的I2C/DDC 信息 仔细看我去掉了那些东西

第二项

分辨率 仔细看

Section "Screen"

Identifier "Screen0"

Device "Card0"

Monitor "Monitor0"

DefaultDepth 24 (我比较懒增添该行默认24)

SubSection "Display"

Viewport 0 0

Depth 24

Modes "1024x768" (告诉系统分辨率为1024x768)

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 4

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 8

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 15

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 16

EndSubSection

SubSection "Display"

Viewport 0 0

Depth 24

EndSubSection

EndSection

一般这样做可以直接测试成功

修改后的 xorg.conf.new 要 cp xorg.conf.new /etc/X11/xorg.conf 后就OK
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: