Go2Linux | Linux Operating System

A site dedicated to: Linux Operating System

Changing screen resolution on the fly

Date: 2008-02-09 00:00:00 -0400

If you want to change your screen resolution, while still running Linux but you are not using Gnome or KDE, which gives good options to change screen resolution, you will have to use the xrandr command

If you enter it alone:

xrandr

You will see something like this:

Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 1280 x 1024
default connected 1280x1024+0+0 0mm x 0mm
   1280x1024      60.0*    47.0     43.0  
   1024x768       85.0     75.0     72.0     70.0     60.0  
   800x600        85.0     75.0     72.0     70.0     60.0     56.0    100.0     90.0  
   640x480        85.0     75.0     72.0     60.0    120.0    100.0     90.0  
   1152x864       75.0     70.0     60.0     47.0     43.0  
   720x576        60.0  
   640x400        75.0     60.0  
   400x300        75.0     60.0  
   320x240        75.0     60.0  
   320x200        75.0     60.0  

Now to change from one resolution to the other just enter and xrandr and the resolution with the -s option, like this example:

xrandr -s 1024x768

and it will change your resolution to 1024x768 (obviously) :).

That option should be listed in your /etc/X11/xorg.conf file in order to appear as a possible option, remember that once you reboot your system you will be back to the default resolution, so if you want something permanent, you will to edit your /etc/X11/xorg.conf and put the desired resolution as the first of the list, here is my Screen section of this file.

Section "Screen"

# The Identifier, Device and Monitor lines must be present

    Identifier  "Screen 1"
    Device      "VESA"
    Monitor     "Generic Monitor"
    #Option "AddARGBGLXVisuals" "true"

# The favoured Depth and/or Bpp may be specified here

    DefaultDepth 24

    SubSection "Display"
        Depth           8
        ViewPort        0 0
        Modes "1024x768" "800x600" "640x480"
    EndSubsection

    SubSection "Display"
        Depth           16
        ViewPort        0 0
        Modes "1024x768" "800x600" "640x480"
    EndSubsection

    SubSection "Display"
        Depth           24
        ViewPort        0 0
        Modes "1280x1024" "1024x768" "800x600" "640x480"
    EndSubsection


EndSection

As you can see the defaul Depth is 24, and in that mode "1280x1024" is the first option, so it will be my startup resolution.

If you liked this article please share it.

powered by TinyLetter

If you want to contact me in any other way, please use the contact page.