在linux中更改、定制显示器的分辨率,有两种方法。
方法1,
一:设置屏幕分辨率,首先要获取显示器的硬件支持参数。
通过三种不同的方法,可以得到参数
1,查看显示的说明书。
2,使用ddcprobe命令查看。如果提示需要安装软件,则安装即可。
Monitorrange 参数,就是水平扫描频率和垂直扫描频率。
3,运行xvidtune 命令
退出xvidtune时(可以按Ctrl+Shift+z),会显示参数 ,我的参数如下
二,备份xorg.conf 为下一步修改服务。
注意,命令中的x,有的是大写X
备份完之后,如果下面的操作有误,可以还原。
三,修改xorg.conf
用vi 或者 gedit 打开 xorg.conf
$ sudo gedit /etc/X11/xorg.conf
xorg.conf 文件如下:
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg
Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
EndSection
Section "Device"
Identifier "Configured Video Device"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
EndSection
找到 Section "Monitor"填写上面获得的参数
Identifier "Configured Monitor"
Vendorname "Generic LCD Display"
Modelname "LCD Panel 1440x900"
Horizsync 31.5-56.0 #垂直
Vertrefresh 56.0 - 65.0 #水平
找到下面的 Section "Screen" 根据需要修改,例如:
方法2,
然后根据提示,进一步设置即可。