以1920×1080为例:
-
xrandr
得到显示设备
如下图,可知目前应用的是VGA1。
➜ xrandr
Screen 0: minimum 8 x 8, current 1024 x 768, maximum 32767 x 32767
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 connected primary 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
1024x768 60.00*
800x600 60.32 56.25
848x480 60.00
640x480 59.94
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
-
cvt
命令得到modeline
➜ ~ cvt 1920 1080
# 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
Modeline "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
- 创建新mode
xrandr
后面跟的是拷贝上个命令的输出。
➜ xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
- 将新mode添加
xrandr --addmode VGA1 1920x1080_60.00
- 输出新的mode
xrandr --output VGA1 --mode 1920x1080_60.00
- 添加到rc文件中使设置在每次开机时自启动
将以下命令添加到.zshrc
中
xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA1 1920x1080_60.00
xrandr --output VGA1 --mode 1920x1080_60.00
- 重启确保可用
网友评论