侯体宗的博客
  • 首页
  • Hyperf版
  • beego仿版
  • 人生(杂谈)
  • 技术
  • 关于我
  • 更多分类
    • 文件下载
    • 文字修仙
    • 中国象棋ai
    • 群聊
    • 九宫格抽奖
    • 拼图
    • 消消乐
    • 相册

ubuntu不能设置高分辨率问题的解决方法

linux  /  管理员 发布于 7年前   301

在ubuntu12.10上安装gnome切换到经典模式后,分别率最高只有1024*768,以为是没有安装显卡驱动导致的,上网搜索了N多方法,安装了各种nvidia驱动,依然没有搞定。
反而把分辨率降低到只能设置为最高854*480,导致窗口按钮都看不到。后来想启动时选择默认模式,不用gnome经典模式,回到默认模式不就可以了,结果还是不行。
然后又把gnome删除,删除时直接使用sudo apt-get remove gnome*, 把所有gnome相关的文件都删除了,就直接导致启动不了。
最后没办法,又重新安装了ubuntu12.10,安装时选择第一项默认的保留已有文档和软件继续安装,结果安装后虽然可以驱动了,但还是最高只能是1024*768的分辨率。
后来又去ubutnu软件中心安装了nvidia当前驱动,还是不行。由于重装时没有选择安装更新,所以又去“软件更新器”安装了更新,更新后重启还是没有作用。
再后来想到升级到13.04,经过一个多小时漫长的等待,升级后结果还是不行。分辨率10.24*768依然不变。
此时搜索“ubuntu 硬件 显示 未知”使,发现了以下文章,按照操作居然成功了,把分辨率设置为了1400*900,虽然“系统设置/显示”里面还是显示未知,但分辨率的确提高了。

(转)ubuntu分辨率设置

以下是本篇文章的内容:

--------------------------------------------------------------->>>
我的一台11寸上网本,装的ubuntu。最近外接了一个19寸显示器。分辨率最多只能是1024x768。显示器设置里显示“未知”显示器。
 用下面的命令可以看到显卡的信息:
 $ lspci | grep VGA
 00:02.0 VGA compatible controller: Intel Corporation Mobile 945GME Express Integrated Graphics Controller (rev 03)
 
 我一直以为是显卡驱动没装好,于是下载了intel显卡linux驱动的源码,并花了几天时间来编译(期间安装了N多它所依赖的包),最终还是没能装成功,还把Xorg搞挂了。无奈还重装了系统。其实intel集成显卡的驱动已经装好了,而且用命令sudo apt-get install xserver-xorg-video-intel也可以安装。
 之后还在网上看到修改/etc/X11/xorg.conf之类的解决方案。我直接头大了。
 最后还是找到了解决方案:xrandr命令。
 首先,直接运行xrandr查看下分辨率的情况:
 $ xrandr
 Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 4096 x 4096
 LVDS1 connected (normal left inverted right x axis y axis)
    1024x600       60.0 +
    800x600        60.3     56.2
    640x480        59.9
 VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
    1024x768       60.0 *
    800x600        60.3     56.2
    848x480        60.0
    640x480        59.9
 标星号的那行就是我正在使用的分辨率。
 下面用cvt命令生成一个modeline,为后续添加分辨率作准备:
 $ cvt 1440 900
 # 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
 Modeline "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
 再运行xrandr --newmode来创建一个分辨率模式,使用“Modeline”后的内容(--rmmode删除这个模式):
 $ xrandr --newmode "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync
 接着用xrandr --addmode把这个模式添加到显示器上(--delmode把这个模式从该显示器上移除):
 $ xrandr --addmode VGA1 "1440x900_60.00"
 最后是应用这个模式:
 $ xrandr --output VGA1 --mode "1440x900_60.00"
 到此,我的屏幕看上去就清爽多了。
 用xrandr查看一下:
 $ xrandr
 Screen 0: minimum 320 x 200, current 1440 x 900, maximum 4096 x 4096
 LVDS1 connected (normal left inverted right x axis y axis)
    1024x600       60.0 +
    800x600        60.3     56.2
    640x480        59.9
 VGA1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
    1024x768       60.0
    800x600        60.3     56.2
    848x480        60.0
    640x480        59.9
    1440x900_60.00   59.9*
 设置完后我的屏幕向左偏出了约5个像素,直接在显示器(硬件)上调就可以了。
 参考:https://wiki.ubuntu.com/X/Config/Resolution
<<<---------------------------------------------------------------

特此感谢!终于搞定了浪费了大半天的问题。

不过,关机重新开机后此设置有时候就没有了,又恢复到原来的分辨率了。

现在把设置新分辨率的命令写到一个sh脚本中,如果分辨率恢复到原来的自动执行此shell文件就可以了。

代码如下:

复制代码代码如下:
#!/bin/bash</p><p># set screen resolution to 1400 * 900</p><p># Query current resolution
echo "Current resolution:"
xrandr
echo "-------------------------------------"</p><p># New one modeline for 1440 * 900
echo "New one modeline for 1440 * 900:"
cvt 1440 900
echo "-------------------------------------"</p><p># Create resolution using "xrandr --newmode" command
echo "Create resolution 1400 * 900:"
xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
echo "-------------------------------------"</p><p># Add the resolution to monitor
echo "Add the resolution to monitor:"
xrandr --addmode VGA1 "1440x900_60.00"
echo "-------------------------------------"</p><p># Apply the resolution
echo "Apply the resolution:"
xrandr --output VGA1 --mode "1440x900_60.00"
echo "-------------------------------------"</p><p># Query current resolution again to determine the settings valid or not
echo "Current resolution after settings:"
xrandr
echo "-------------------------------------"


设置分辨率1680 * 1050的shell脚本如下:


复制代码代码如下:
#!/bin/bash</p><p># set screen resolution to 1680×1050</p><p># Query current resolution
echo "Current resolution:"
xrandr
echo "-------------------------------------"</p><p># New one modeline for 1680×1050
echo "New one modeline for 1680×1050:"
cvt 1680 1050
echo "-------------------------------------"</p><p># Create resolution using "xrandr --newmode" command
echo "Create resolution 1680×1050:"
xrandr --newmode "1680x1050_60.00" 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync
echo "-------------------------------------"</p><p># Add the resolution to monitor
echo "Add the resolution to monitor:"
xrandr --addmode VGA1 "1680x1050_60.00"
echo "-------------------------------------"</p><p># Apply the resolution
echo "Apply the resolution:"
xrandr --output VGA1 --mode "1680x1050_60.00"
echo "-------------------------------------"</p><p># Query current resolution again to determine the settings valid or not
echo "Current resolution after settings:"
xrandr
echo "-------------------------------------"


  • 上一条:
    Ubuntu关闭按钮移到右上角的设置方法
    下一条:
    ubuntu xrandr修改显示器分辨率(临时效果)
  • 昵称:

    邮箱:

    0条评论 (评论内容有缓存机制,请悉知!)
    最新最热
    • 分类目录
    • 人生(杂谈)
    • 技术
    • linux
    • Java
    • php
    • 框架(架构)
    • 前端
    • ThinkPHP
    • 数据库
    • 微信(小程序)
    • Laravel
    • Redis
    • Docker
    • Go
    • swoole
    • Windows
    • Python
    • 苹果(mac/ios)
    • 相关文章
    • 在Linux系统中使用Iptables实现流量转发功能流程步骤(0个评论)
    • vim学习笔记-入门级需要了解的一些快捷键(0个评论)
    • 在centos7系统中实现分区并格式化挂载一块硬盘到/data目录流程步骤(0个评论)
    • 在Linux系统种查看某一个进程所占用的内存命令(0个评论)
    • Linux中grep命令中的10种高级用法浅析(0个评论)
    • 近期文章
    • 在go中实现一个常用的先进先出的缓存淘汰算法示例代码(0个评论)
    • 在go+gin中使用"github.com/skip2/go-qrcode"实现url转二维码功能(0个评论)
    • 在go语言中使用api.geonames.org接口实现根据国际邮政编码获取地址信息功能(1个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf分页文件功能(0个评论)
    • gmail发邮件报错:534 5.7.9 Application-specific password required...解决方案(0个评论)
    • 欧盟关于强迫劳动的规定的官方举报渠道及官方举报网站(0个评论)
    • 在go语言中使用github.com/signintech/gopdf实现生成pdf文件功能(0个评论)
    • Laravel从Accel获得5700万美元A轮融资(0个评论)
    • 在go + gin中gorm实现指定搜索/区间搜索分页列表功能接口实例(0个评论)
    • 在go语言中实现IP/CIDR的ip和netmask互转及IP段形式互转及ip是否存在IP/CIDR(0个评论)
    • 近期评论
    • 122 在

      学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..
    • 123 在

      Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..
    • 原梓番博客 在

      在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
    • 博主 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 @1111老铁这个不行了,可以看看近期评论的其他文章..
    • 1111 在

      佛跳墙vpn软件不会用?上不了网?佛跳墙vpn常见问题以及解决办法中评论 网站不能打开,博主百忙中能否发个APP下载链接,佛跳墙或极光..
    • 2016-11
    • 2017-07
    • 2017-10
    • 2017-11
    • 2018-01
    • 2018-02
    • 2020-03
    • 2020-04
    • 2020-05
    • 2020-06
    • 2021-02
    • 2021-03
    • 2021-04
    • 2021-06
    • 2021-07
    • 2021-08
    • 2021-09
    • 2021-10
    • 2021-11
    • 2021-12
    • 2022-01
    • 2022-03
    • 2022-04
    • 2022-08
    • 2022-11
    • 2022-12
    • 2023-01
    • 2023-02
    • 2023-03
    • 2023-06
    • 2023-07
    • 2023-10
    • 2023-12
    • 2024-01
    • 2024-04
    Top

    Copyright·© 2019 侯体宗版权所有· 粤ICP备20027696号 PHP交流群

    侯体宗的博客