Sunday, September 12, 2010

How to Add and Set Custom Display Resolutions using xrandr Command on ubuntu 10.04 (lucid lynx) Linux

You can change your monitor's display resolution from system->preferences->monitors,but in some cases Linux fails to detect the proper resolutions for your monitor,in such situations we can add and set custom resolutions with a little effort by using xrandr command.

As it is said in the man pages:

     “ Xrandr  is  used  to set the size, orientation and/or reflection of the
        outputs for a screen. It can also set the screen size.

        If invoked without any option, it will dump the state of  the  outputs,
        showing  the existing modes for each of them, with a '+' after the pre‐
        ferred mode and a '*' after the current mode.......”

Here is the output of my terminal window when I issued the xrandr with -q option:

sunny@usmanriaz-desktop:~$ xrandr -q


Screen 0: minimum 320 x 200, current 1280 x 768, maximum 4096 x 4096
VGA connected 1280x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1360x768       59.8 
   1152x864       60.0 
   1024x768       60.0 
   800x600        60.3 
   640x480        59.9 
   1280x768_60.00   59.5*

To add a new mode xrandr provides us '--newmode' and '--addmode' options which are used to create and associate modes for the perticular display respectively.

--newmode option also requires a mode line .For example if you want to add a resolution 1280x800
the mode line will be:

"1280x800_60.00"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync

I have calculated the above mode line using  cvt  (VESA Coordinated Video Timing)  utility by issuing the following command:
sunny@usmanriaz-desktop:~$ cvt 1280 800
(note: replace 1280 800 with your required resolution)

# 1280x800 59.81 Hz (CVT 1.02MA) hsync: 49.70 kHz; pclk: 83.50 MHz
Modeline "1280x800_60.00"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync

Now we have the mode line next step is to use this mode line with --newmode option as follows:

sunny@usmanriaz-desktop:~$ xrandr --newmode "1280x800_60.00"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync

After the above command your mode will be listed in the xrandr -q output take a look at this output:

# xrandr -q

   1360x768       59.8 
   1152x864       60.0 
   1024x768       60.0 
   800x600        60.3 
   640x480        59.9 
   1280x768_60.00   59.5*
   1280x800_60.00 (0x123)   83.0MHz
        h: width  1280 start 1352 end 1480 total 1680 skew    0 clock   49.4KHz
        v: height  800 start  803 end  809 total  831           clock   59.5Hz

Now I am going to associate this mode with VGA(current connected display name) it can be different on your machine.

sunny@usmanriaz-desktop:~$ xrandr --addmode VGA 1280x800_60.00

To set this custom mode on your display just type the following command:

# xrandr --output VGA --mode 1280x800_60.00


The Last Thing :

Though by following above steps we can change the resolution but these changes will  not be permanent , your old resolution will be restored when you reboot your system.

To make these changes permanent type in the following command in your terminal :
# sudo vim  /etc/gdm/Init/Default

and put the following commands before the Line Number 11 as shown in figure:

# xrandr --newmode "1280x800_60.00"   83.50  1280 1352 1480 1680  800 803 809 831 -hsync +vsync

#xrandr --addmode VGA 1280x800_60.00

# xrandr --output VGA --mode 1280x800_60.00

Please write me your comments and correct me on my mistakes ..!


  1. When I try to use xrandr --addmode HDMI-0 1176x664_60.00 i get an error!

    This is the output error:
    X Error of failed request: BadMatch (invalid parameter attributes)
    Major opcode of failed request: 140 (RANDR)
    Minor opcode of failed request: 18 (RRAddOutputMode)
    Serial number of failed request: 29
    Current serial number in output stream: 30

    What should I do to fix it?

  2. You should put a # before xrandr to force add it.

  3. And if you have mint 14 it is sudo cat /usr/share/alsa/init/default

  4. We create websites for customers large and small with innovative designs, visual impact and bespoke levels of functionality.Webbitez are a friendly UK based company with the in-house skills mix to create websites and associated marketing materials. Our core skills include marketing experience, design, professional photography plus coding expertise and programming capabilities. Web Design Belfast Northern Ireland | SEO Belfast Northern Ireland | Logo Design Northern Ireland UK | Hosting Services Northern Ireland UK | Ecommerce Sites Belfast Northern Ireland |

  5. All service providers problems solved with fast, accurate, with a simple phone contact number for all your favourite Websites. Having difficulties with a social network site? Or need help or advice with any social networking issues and cant find a providers telephone contact number? Direct Contact Numbers will cut out all the relentless searching for telephone numbers online. Facebook Helpline Contact Number | Amazon Helpline Contact Number | Gmail Helpline Contact Number | Google Helpline Contact Number | Twitter Helpline Contact Number |

  6. On firing xrandr --output ... , my screen went black and I had to hard boot ...

  7. Thank you for sharing valuable information. Nice post. I enjoyed reading this post. The whole blog is very nice found some good stuff and good information here Thanks..Also visit my page.seo services Our team always avoid generic web designing because we know from experience that every business is unique in its approach and every industry operates under different dynamics.

  8. Acetech has many years of experience in custom software development. Find out more about custom software development at

  9. Thanks For Your valuable posting, it was very informative. Am working in Erp Software Company In India

  10. Thanks For Your valuable posting, it was very informative. ADC developing custom websites

  11. Your blog giving me nice feedback. This is very effective blog for help me. Please post more related blogs. Thank you for this support.

    Visit :- Bespoke Software Development

  12. email blast to tenants

    Special event parking software
    Software is used generally by people who are professionals in handling technology such as computers and other modern technology. Technology today is common to all and everyone is not denying that fact. It is not only used for better communication but in almost anything to make people’s lives easy. Among these is in parking, especially in high-volume events.
    With new software in organizing, tracking and monitoring an event’s parking, you no longer need to worry about bringing your own vehicle. This is due to automated management of parking spaces with the use of software. Parking spaces, whether big or small are needed for car owners because they strive to park in their convenient time. Certain establishments own large parking spaces but different problem occurs because of the possibility of endless car owners bringing their own cars in certain places. This software serves enforcement to all car owners who wanted to access in an event is called the special event parking software. This software expertly provides high and dignified solution between customers who are in the state of parking crisis when they are in an event. It listens and provides a unified solution every time the customers requested it. They can easily install or get the software immediately in which the parking management should uphold the excellence with the customer. Considering special events, the software is needed to sustain manageable parking spaces between customers.
    A tracking device is installed on special event parking software that is used to command or coordinate with the parking spaces when certain events or occasions happen. If a problem occurs in an event, it results to poor and unorganized event organizer which causes for them to shut down software or postponed said events. Following this, others will be tempted to visit or enjoy to different events. Occasionally, hotels, restaurants and other establishments offer to organize events or parties in their parking spaces which different kind of personalities are frequently joining. In the event, the parking space of the said establishments has big parking space for the event. It is not a problem but how about the small establishments, who organize a party but contains small space, special event parking software is ready to help.
    Events are operated by agencies or organizers which they wanted to support and provide their customers with worthwhile and great parking space. Their main goal is to gain a successful and perfect event in that parking spaces they choose. The positive impression of special event parking software is to provide their customers how to make parking management successful. Supervising parking space to make it more conducive for organizing or hosting special events is very difficult but maintaining parking spaces is a different idea. In maintaining such one, special event parking software is taking the action providing harmonious and efficient positive results at the end. Different procedures should be followed and must be taking into consideration the various strategies on how to make smaller parking spaces become bigger. Site: www.webparkingsoftware.comm


Follow me

Join me on the New Digg Follow ur_sunny on Twitter
There was an error in this gadget