• Ubuntu设置屏幕分辨率


    Ubuntu设置屏幕分辨率

    原创 2016年10月14日 13:01:24
       在虚拟机装好Ubuntu,进入系统分辨率是800*600,打开显示界面设置下分辨率,设置完怎么也选不上应用,于是只能通过命令设置来解决问题。
       使用xrandr可以查看系统当前支持哪些分辨率,以及当前设置的分辨率。下面显示的是我调整后的。
    
    • 1
    • 2
    • 3
    soft@soft-virtual-machine:~$ xrandr
    Screen 0: minimum 1 x 1, current 1440 x 900, maximum 8192 x 8192
    Virtual1 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
       800x600       60.00 +  60.32  
       2560x1600     59.99  
       1920x1440     60.00  
       1856x1392     60.00  
       1792x1344     60.00  
       1920x1200     59.88  
       1600x1200     60.00  
       1680x1050     59.95  
       1400x1050     59.98  
       1280x1024     60.02  
       1440x900      59.89* 
       1280x960      60.00  
       1360x768      60.02  
       1280x800      59.81  
       1152x864      75.00  
       1280x768      59.87  
       1024x768      60.00  
       640x480       59.94  
    Virtual2 disconnected (normal left inverted right x axis y axis)
    Virtual3 disconnected (normal left inverted right x axis y axis)
    Virtual4 disconnected (normal left inverted right x axis y axis)
    Virtual5 disconnected (normal left inverted right x axis y axis)
    Virtual6 disconnected (normal left inverted right x axis y axis)
    Virtual7 disconnected (normal left inverted right x axis y axis)
    Virtual8 disconnected (normal left inverted right x axis y axis)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
       如果列表中没有符合你的标准的可以通过cvt自己定义一个。
    
    • 1
    • 2
    soft@soft-virtual-machine:~$ cvt --help
    
    usage: cvt [-v|--verbose] [-r|--reduced] X Y [refresh]
    
     -v|--verbose : Warn about CVT standard adherance.
     -r|--reduced : Create a mode with reduced blanking (default: normal blanking).
                X : Desired horizontal resolution (multiple of 8, required).
                Y : Desired vertical resolution (required).
          refresh : Desired refresh rate (default: 60.0Hz).
    
    Calculates VESA CVT (Coordinated Video Timing) modelines for use with X.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
       设置一个分辨率为1280*1024,刷新频率为60Hz的分辨率设置:
    
    • 1
    • 2
    soft@soft-virtual-machine:~$ cvt 1280 1024 60
    # 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
    Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
    
    • 1
    • 2
    • 3
    • 4
       Modeline "1280x1024_60.00"后面就是该分辨率相关的信息。通过xrandr --newmode把他加入到分辨率列表中。
       使用xrandr 创建新的mode,--newmode后面跟刚刚cvt产生的modeline信息。 
    
    • 1
    • 2
    • 3
    root@soft-virtual-machine:/home/soft# xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
    root@soft-virtual-machine:/home/soft# xrandr
    Screen 0: minimum 1 x 1, current 1440 x 900, maximum 8192 x 8192
    Virtual1 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
       800x600       60.00 +  60.32  
       2560x1600     59.99  
       1920x1440     60.00  
       1856x1392     60.00  
       1792x1344     60.00  
       1920x1200     59.88  
       1600x1200     60.00  
       1680x1050     59.95  
       1400x1050     59.98  
       1280x1024     60.02  
       1440x900      59.89* 
       1280x960      60.00  
       1360x768      60.02  
       1280x800      59.81  
       1152x864      75.00  
       1280x768      59.87  
       1024x768      60.00  
       640x480       59.94  
    Virtual2 disconnected (normal left inverted right x axis y axis)
    Virtual3 disconnected (normal left inverted right x axis y axis)
    Virtual4 disconnected (normal left inverted right x axis y axis)
    Virtual5 disconnected (normal left inverted right x axis y axis)
    Virtual6 disconnected (normal left inverted right x axis y axis)
    Virtual7 disconnected (normal left inverted right x axis y axis)
    Virtual8 disconnected (normal left inverted right x axis y axis)
      1280x1024_60.00 (0x246) 109.000MHz -HSync +VSync
            h: width  1280 start 1368 end 1496 total 1712 skew    0 clock  63.67KHz
            v: height 1024 start 1027 end 1034 total 1063           clock  59.89Hz
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
       添加新的mode,--addmode后面第一个参数是xrandr显示出来的列表中,你要更改目标输出的设备名称,在我这里是Virtual0.如果是直接接显示器的,可能是VGA或者其他什么的。
    
    • 1
    • 2
    root@soft-virtual-machine:/home/soft# xrandr --addmode Virtual0 "1280x1024_60.00"
    • 1
       添加完之后,需要做的就是将分辨率应用到指定的输出设备。
    
    • 1
    • 2
    root@soft-virtual-machine:/home/soft#  xrandr --output Virtual0 --mode "1280x1024_60.00" 
    • 1
       也可通过xrandr -s 来实现。
    
    • 1
    • 2
    root@soft-virtual-machine:/home/soft# xrandr -s 1280x1024_60.02
    • 1
       持久地记忆这个新添加的分辨率 在~/.xprofile中加入下面语句 xrandr --output VBOX0 --mode 1280x1024_60.02
    
    • 1
    • 2
    版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/rznice/article/details/52815060
  • 相关阅读:
    request对象
    js基础3
    Andorid Binder进程间通信---总结
    java 获取系统变量(环境变量和设置变量)
    參加项目管理培训的一些体会
    select poll使用
    关注关注工作行列
    jquery——zTree, 完美好用的树插件
    OSI七层模型具体解释
    (原创)优酷androidclient 下载中 bug 解决
  • 原文地址:https://www.cnblogs.com/javaboy2018/p/8884412.html
Copyright © 2020-2023  润新知