ubuntu自定義分辨率

首先說下爲啥要專門敲個文章來講明這個問題,由於我最近入手了一臺分辨率爲3200*1800的高分辨率筆記本,但使用的時候發現如今的操做系統及其諸多軟件對高分辨率屏幕的支持真的是太爛,字體發虛或者變得很是小,而我又不想把分辨率調回低分辨率,這樣就浪費了屏幕。html

首先我想在win10下使用虛擬機VMware Workstation 安裝Ubuntu,而後以便在linux上developing,可是發現裝完以後分辨率顯示效果很是差。狀況以下:linux

一、shell

筆記本:13.3寸,分辨率3200*1800ubuntu

主機操做系統:win10bash

虛擬機:VMware Workstation 11工具

從機操做系統:Ubuntu14.04.03 (Unity)字體

裝完發現Ubuntu 默認分辨率800*600,而且Setting——>Display(系統設置——>顯示)中無3200*1800的分辨率可選擇,因此本身自定義分辨率:spa

解決方案:xrandr命令。操作系統

 首先,直接運行xrandr查看下分辨率的狀況:
 
 標星號的那行就是我正在使用的分辨率(800*600)。
 下面用cvt命令生成一個modeline,爲後續添加分辨率做準備:
 
 

 
再運行xrandr --newmode來建立一個分辨率模式,使用「Modeline」後的內容(--rmmode刪除這個模式)
 

 接着用xrandr --addmode把這個模式添加到顯示器上(--delmode把這個模式從該顯示器上移除),再次使用xrandr可發現已經添加上去了:

 
最後是應用這個模式:
命令: xrandr --output VGA1 --mode "3200x1800_60.00"
使用命令後,能夠發現字體都變得很是小,看不清了,以下:

 用xrandr查看一下,能夠發現分辨率已經修改成3200*1800了:
 
wang@ubuntu:~$ xrandr
Screen 0: minimum 1 x 1, current 3200 x 1800, maximum 8192 x 8192
Virtual1 connected primary 3200x1800+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800x600 60.0 + 60.3 
2560x1600 60.0 
1920x1440 60.0 
1856x1392 60.0 
1792x1344 60.0 
1920x1200 59.9 
1600x1200 60.0 
1680x1050 60.0 
1400x1050 60.0 
1280x1024 60.0 
1440x900 59.9 
1280x960 60.0 
1360x768 60.0 
1280x800 59.8 
1152x864 75.0 
1280x768 59.9 
1024x768 60.0 
640x480 59.9 3200x1800_60.00 60.0* 
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)

可是字體過小了,因此接下來咱們須要調大字體,很是簡單,直接在display中設置,以下:.net

把Scale for menu and title bar的數值調成2.5,發現,效果好不少。


<<<---------------------------------------------------------------

  到此,個人屏幕看上去就清爽多了。

 

不過,關機從新開機後此設置有時候就沒有了,又恢復到原來的分辨率了。

如今把設置新分辨率的命令寫到一個sh腳本中,若是分辨率恢復到原來的自動執行此shell文件就能夠了。

如何添加自啓動程序請參考:Ubuntu添加開機自動啓動程序方法

shell代碼以下:

#!/bin/bash
# set screen resolution to 3200x1800
cvt 3200 1800
xrandr --newmode "3200x1800_60.00"  492.00  3200 3456 3800 4400  1800 1803 1808 1865 -hsync +vsync
xrandr --addmode Virtual1 "3200x1800_60.00"
xrandr --output Virtual1 --mode "3200x1800_60.00"

搞定了。。

 

二、下面講下在Gnome 3桌面系統下如何設置分辨率:

Ubuntu Gnome版本爲例:

方法基本差很少,只有一步不一樣(設置字體大小),Gnome 3設置字體大小,須要一條shell命令,以下:

參考:How to properly change window scalling factor in gnome

gsettings set org.gnome.desktop.interface scaling-factor 2

立馬發現字體變大,果真效果清晰不少

 

 

將Gnome下shell代碼以下:

 

#!/bin/bash
# set screen resolution to 3200x1800
cvt 3200 1800
xrandr --newmode "3200x1800_60.00"  492.00  3200 3456 3800 4400  1800 1803 1808 1865 -hsync +vsync
xrandr --addmode Virtual1 "3200x1800_60.00"
xrandr --output Virtual1 --mode "3200x1800_60.00"
gsettings set org.gnome.desktop.interface scaling-factor 3

一樣設置自啓動,問題解決

 擴展:
實際上對Gnome 3桌面系統,還能夠經過工具 Gnome Tweak Tool 來自定義更多東西
 
相關文章
相關標籤/搜索