http://www.linuxreaders.com/2009/11/04/change-ubuntu-9-10-resolution/
By default Ubuntu 9.10 supports 1024×768 resolution, which is not enough for me. I needed to increase it to 1240×1024. To achive my desired resolution I run through few commands. Its easy, take a look.
Here I am trying to get 1240×1024 resolution, if you are trying to achive any other change it with 1240×1024
Use xrandr to find current mode used & output name.
e.g here VGA1 is used, it is easy to use current output name.
- xrandr
- Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192
- VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 310mm x 230mm
- 1024x768 85.0*+ 75.1
- 800x600 75.0
- 640x480 75.0 60.0
- 720x400 70.1
xrandr Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192 VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 310mm x 230mm 1024x768 85.0*+ 75.1 800x600 75.0 640x480 75.0 60.0 720x400 70.1
Run following command to find modeline details for resolution 1240×1024. Modeline is required for xrandr.
- cvt 1240 1024
- # 1240x1024 59.93 Hz (CVT) hsync: 63.71 kHz; pclk: 105.50 MHz
- Modeline "1240x1024_60.00" 105.50 1240 1320 1448 1656 1024 1027 1037 1063 -hsync +vsync
cvt 1240 1024 # 1240x1024 59.93 Hz (CVT) hsync: 63.71 kHz; pclk: 105.50 MHz Modeline "1240x1024_60.00" 105.50 1240 1320 1448 1656 1024 1027 1037 1063 -hsync +vsync
Use modeline config with xrandr to add resolution mode.
- xrandr --newmode "1240x1024_60.00" 105.50 1240 1320 1448 1656 1024 1027 1037 1063 -hsync +vsync
xrandr --newmode "1240x1024_60.00" 105.50 1240 1320 1448 1656 1024 1027 1037 1063 -hsync +vsync
e.g output of command xrandr with new resolution
- xrandr
- Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192
- VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 310mm x 230mm
- 1024x768 85.0*+ 75.1
- 800x600 75.0
- 640x480 75.0 60.0
- 720x400 70.1
- 1240x1024_60.00 (0x102) 105.5MHz
- h: width 1240 start 1320 end 1448 total 1656 skew 0 clock 63.7KHz
- v: height 1024 start 1027 end 1037 total 1063 clock 59
xrandr Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192 VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 310mm x 230mm 1024x768 85.0*+ 75.1 800x600 75.0 640x480 75.0 60.0 720x400 70.1 1240x1024_60.00 (0x102) 105.5MHz h: width 1240 start 1320 end 1448 total 1656 skew 0 clock 63.7KHz v: height 1024 start 1027 end 1037 total 1063 clock 59
Use following command to add new mode
- xrandr --addmode VGA1 1240x1024_60.00
xrandr --addmode VGA1 1240x1024_60.00
Use following to change output imidiately Or use System–> Preferenses –> Display
- xrandr --output VGA1 --mode 1240x1024_60.00
xrandr --output VGA1 --mode 1240x1024_60.00
Since above command is not permanent sollution to add new resolution, you need to edit /etc/gdm/PreSession/Default
Enter followings at the end of file /etc/gdm/PreSession/Default
- xrandr --newmode "1240x1024_60.00" 105.50 1240 1320 1448 1656 1024 1027 1037 1063 -hsync +vsync
- xrandr --addmode VGA1 1240x1024_60.00
xrandr --newmode "1240x1024_60.00" 105.50 1240 1320 1448 1656 1024 1027 1037 1063 -hsync +vsync xrandr --addmode VGA1 1240x1024_60.00
After reboot this will enable one more resolution mode in System–> Preferenses –> Display
all you need to do is to select desired mode once.
if you wish to remove any mode
- xrandr --rmmode 1240x1024_60.00
xrandr --rmmode 1240x1024_60.00
转载于:https://www.cnblogs.com/binterminator/articles/1603225.html