Tuesday, January 15, 2013

Changing the Resolution in Ubuntu

Well, after having this set up, I wanted to be able switch resolutions (the screen is really tiny, and it drops the frame-rate of games rather significantly)  I tried all of the standard xorg.conf configuration, addmode, newmode, all of that.  But nothing worked.

Today, I stumbled on a solution:  xrandr's --scale option.  This allows you to scale that screen to almost any resolution you want.

 for example:
  • xrandr -q 
(this returns certain names e.g. mine is DP-2. Another is HDMI-0.  One will say "connected" and that's the one you need.
  • xrandr  --output DP-2 --scale .5x.5 
This scales it to a 1440x900 resolution.

One thing to note.  Sometimes trying to go from one scaled resolution to another will fail with an error.  Don't panic:  just change the scale back to 1x1, and the next scale you choose will work. The scaling numbers don't have to be simple: I managed to get ~1650x1050 by putting the scale value as .5729x.5729.

Here's a link to the script:  https://gist.github.com/4552263/

This script takes one parameter: the width in pixels of your screen.

Sample run:

   sh ./Res.sh 1680

The result is a 1680x1050 scaled screen.

EDIT:  I found a way to fix the trackpad settings.
I followed this advice here:  uselessuseofcat.com/?p=74ls,
but it didn't quite help with the trackpad's tap-click.
I then found this package: gpointing-device-settings

    sudo apt-get install  gpointing-device-settings

This installs a utility that is launched by running
in the terminal.

This is a graphical configuration for your trackpad, so you should be able to customize your mouse however you want.


  1. How is the dual monitor support with/without the script?

  2. nice script/ dual monitor works great!

  3. Thank you for posting this. I've been using this method to make the screen usable, but using any non-native resolution makes everything pretty fuzzy. I have been trying to raise the DPI, but that has not had any noticeable effects for me yet. Don't get me wrong. I'm happy you posted this, I'm just a little bummed that there isn't a better solution yet.

  4. I'm hoping both NVIDIA and Gnome-type desktops (Unity, Cinnamon, MATE, etc) get their act together here. Nvidia drivers make the scaling look worse, and only the KWin compositor successfully scales the screen (but only with nouveau running) I've heard that there is a project that is supposed to make the NVIDIA binary blob work better with Linux systems, but it isn't finished, and it looks like it's going to require kernel 3.9, which isn't in the standard installs of Ubuntu yet. Link to story here: http://www.phoronix.com/scan.php?page=news_item&px=MTMwMjI I haven't been able to get nvidia working on my latest install of Linux, and at this point I'd prefer it if nouveau finished their open source driver's 3D acceleration than nvidia to release another version, considering how well the nouveau driver works for most things including changing screen resolution compared to NVIDIA where it works for intensive things (like gaming), but not always for simpler things. (the afore-mentioned screen resolution issue being one of them)

  5. hi...Im student from Informatics engineering nice article,
    thanks for sharing :)

  6. congratulations guys, quality information you have given!!! Anup Kayastha

  7. sửa chữa macbook, sửa macbook, sua chua macbook, macbook ha noi
    công ty tien thanh computer chuyên sửa chữa macbook,imac,iphone ,ipad uy tín tại hà nội,
    thay thế sửa chữa tất cả các dòng máy của apple trên thị trường hiện tại ,với giá cả cạnh tranh , dịch vụ uy tín ,
    địa chỉ duy nhất tại hà nội thu mua macbook, iphone, ipad ,imac cũ, vỡ nát giá cao nhất tại hà nội
    hotline: 0936.03.11.05
    hãy đến với tiên thành để được phục vụ chuyên nghiệp nhất