Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I got problems with nvidia drivers, after I installed them and reboot my desktop is to big for my screen. I can only see some piece of the background.

share|improve this question
add comment

1 Answer 1

According to Ubuntu Wiki you can use following options to set your screen resolution to correct value:

  1. Resetting an out-of-range resolution
    If you set a resolution inappropriate for your monitor in the Screen Resolution GUI tool, you can reset it from a terminal by running:

    $ rm ~/.config/monitors.xml
    
  2. Dynamically testing different resolutions
    You can either use the Screen Resolution GUI tool to experiment with different resolutions, or the more powerful xrandr command-line tool. Without parameters, xrandr shows you the names of different outputs available on your system (LVDS, VGA-0, etc.) and resolutions available on each:

    $ xrandr
    Screen 0: minimum 320 x 200, current 1400 x 1050, maximum 1400 x 1400
    VGA disconnected (normal left inverted right x axis y axis)
    LVDS connected 1400x1050+0+0 (normal left inverted right x axis y axis) 286mm x 214mm
       1400x1050      60.0*+   50.0  
    [...]
    

    You can direct xrandr to set a different resolution like this:

    $ xrandr --output LVDS --mode 1024x768
    $ xrandr --output VGA1 --mode 1024x768
    

    The refresh rate may also be changed, either at the same time or independently:

    $ xrandr --output LVDS --mode 1024x768 --rate 75
    $ xrandr --output VGA1 --mode 1024x768 --rate 60
    

Setting xrandr changes persistently

There are several ways to make xrandr customizations permanent from session to session: a) .xprofile, b) kdm/gdm, c) xorg.conf. Each of these mechanisms will be discussed in turn.

Setting xrandr commands in .xprofile

A user's ~/.xprofile file is executed on Xorg startup if it exists and is executable. You can copy and paste xrandr command line strings into this file so they're executed when you log in. For example:

$ xrandr --output VGA-0 --mode 800x600

There are two disadvantages to using .xprofile for xrandr settings. First, it occurs fairly late in the startup process, so you'll see some resolution resizing during the initial screen draw; in some cases panel windows may resize improperly as a result. Second, as this is a per-user setting, it won't affect the resolutions of other users, nor will it alter the resolution on the login screen.

Setting xrandr commands in kdm/gdm startup scripts

Both KDM and GDM have startup scripts that are executed when X is initiated. For GDM, these are in /etc/gdm/ , while for KDM this is done at /etc/kde4/kdm/Xsetup. In either case, you can paste in an xrandr command line string into one of these scripts. For GDM, try putting them right before

initctl -q emit login-session-start DISPLAY_MANAGER=gdm

in /etc/gdm/Init/Default.

This process requires root access and mucking around in system config files, but will take effect earlier in the startup process than using .xprofile, and will apply to all users including the login screen.

Setting resolution changes in xorg.conf

While xorg.conf is largely empty these days, it can still be used for setting up resolutions. For example:

Section "Monitor"
    Identifier      "External DVI"
    Modeline        "1280x1024_60.00"  108.88  1280 1360 1496 1712  1024 1025 1028 1060  -HSync +Vsync
    Option          "PreferredMode" "1280x1024_60.00"
EndSection
Section "Device"
    Identifier      "ATI Technologies, Inc. M22 [Radeon Mobility M300]"
    Driver          "ati"
    Option          "Monitor-DVI-0" "External DVI"
EndSection
Section "Screen"
    Identifier      "Primary Screen"
    Device          "ATI Technologies, Inc. M22 [Radeon Mobility M300]"
    DefaultDepth    24
    SubSection "Display"
        Depth           24
        Modes   "1280x1024" "1024x768" "640x480"
    EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Primary Screen"
EndSection

See man xorg.conf for full details on how to craft an xorg.conf file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.