ubuntu不能設置高分辨率問題的解決方法

在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 "-------------------------------------"
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章