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

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

−

<pre>

+

xrandr --output LVDS --mode 1024x768 --rate 75

−

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

+

−

</pre>

+

−

+

−

Note that changes you make using <tt>xrandr</tt> only last through the current session. xrandr has a lot more capabilities - see <tt>man xrandr</tt> for details.

+

+

{{Note|Changes you make using {{Ic|xrandr}} only last through the current session. xrandr has a lot more capabilities - see {{Ic|man xrandr}} for details.}}

== Adding undetected resolutions ==

== Adding undetected resolutions ==

−

Due to buggy hardware or drivers, your monitor's correct resolutions may not always be detected. For example, the EDID data block queried from your monitor may be incorrect.

+

Due to buggy hardware or drivers, your monitor's correct resolutions may not always be detected by xrandr. For example, the EDID data block queried from the monitor may be incorrect. However, we can add the desired resolutions to xrandr.

−

If the mode already exists, but just isn't associated for the particular output, you can add it like this:

+

First we run {{ic|gtf}} or {{ic|cvt}} to get the '''Modeline''' for the resolution we want:

−

<pre>

+

For some LCD screens (samsung 2343NW), the command "cvt -r" (= with reduced blanking) is to be used.

−

$ xrandr --addmode S-video 800x600

+

−

</pre>

+

−

If the mode doesn't yet exist, you'll need to '''create it first''' by specifying a modeline:

Then we create a new xrandr mode. Note that the Modeline keyword needs to be ommited.

−

$ xrandr --newmode <Mode Line>

+

−

</pre>

+

−

You may create a modeline using the <tt>gtf</tt> or <tt>cvt</tt> utility. For example, if you want to add a mode with resolution 800x600, you can enter the following command: (The output is shown following.)

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.

+

Note that these settings only take effect during this session.

−

=== Setting xrandr commands in .xprofile ===

+

If you are not sure about the resolution you will test, you may add a "sleep 5" and a safe resolution command line following, like this :

−

A user's <tt>~/.xprofile</tt> 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:

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.

+

== Making xrandr changes persistent ==

−

=== Setting xrandr commands in kdm/gdm startup scripts ===

+

There are several ways to make xrandr customizations permanent from session to session:

+

* {{ic|xorg.conf}} ( Preferred)

+

* {{ic|.xprofile}}

+

* kdm/gdm

−

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

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.

+

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

−

=== Setting resolution changes in xorg.conf ===

+

{{hc|/etc/X11/xorg.conf|

−

+

−

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

+

−

+

−

<pre>

+

Section "Monitor"

Section "Monitor"

Identifier "External DVI"

Identifier "External DVI"

Line 119:

Line 89:

Screen "Primary Screen"

Screen "Primary Screen"

EndSection

EndSection

−

</pre>

+

}}

−

See <tt>man xorg.conf</tt> for full details on how to craft an <tt>xorg.conf</tt> file.

+

See {{Ic|man xorg.conf}} for full details on how to craft an {{ic|xorg.conf}} file.

+

+

=== Setting xrandr commands in xprofile ===

+

+

See [[Execute commands after X start]].

+

+

This method has the disadvantage of occurring fairly late in the startup process thus it will not alter the resolution of the [[Display Manager]] if you use one.

+

+

=== 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 {{ic|/etc/gdm/}} , while for KDM this is done at {{ic|/usr/share/config/kdm/Xsetup}}.

+

+

This process requires root access and mucking around in system config files, but will take effect earlier in the startup process than using xprofile.

+

+

== Graphical frontends ==

+

There are some graphical frontends available for {{ic|xrandr}}:

+

+

=== ARandR ===

+

ARandR provides a simple and convenient visual front end.

+

+

The package can be found in the community repository: {{Pkg|arandr}}

+

+

=== LXrandR ===

+

The default monitor configuration tool for the [[LXDE]] desktop environment.

If you video card is recognized but the resolution is lower than you expect, you may try this.

If you video card is recognized but the resolution is lower than you expect, you may try this.

Background: ATI X1550 based video card and two LCD monitors DELL 2408(up to 1920x1200) and Samsung 206BW(up to 1680x1050). Upon first login after installation, the resolution default to 1152x864. xrandr does not list any resolution higher than 1152x864. You may want to try editing /etc/X11/xorg.conf, add a section about virtual screen, logout, login and see if this helps. If not then read on.

Background: ATI X1550 based video card and two LCD monitors DELL 2408(up to 1920x1200) and Samsung 206BW(up to 1680x1050). Upon first login after installation, the resolution default to 1152x864. xrandr does not list any resolution higher than 1152x864. You may want to try editing /etc/X11/xorg.conf, add a section about virtual screen, logout, login and see if this helps. If not then read on.

−

Change the default xorg.conf

+

Change xorg.conf

−

<pre>

+

{{hc|/etc/X11/xorg.conf|

−

Section "Device"

+

−

Identifier "Configured Video Device"

+

−

EndSection

+

−

+

−

Section "Monitor"

+

−

Identifier "Configured Monitor"

+

−

EndSection

+

−

+

Section "Screen"

Section "Screen"

−

Identifier "Default Screen"

+

...

−

Monitor "Configured Monitor"

+

SubSection "Display"

−

Device "Configured Video Device"

+

Virtual 3600 1200

−

EndSection

+

EndSubSection

−

</pre>

+

−

To

+

−

<pre>

+

−

Section "Monitor"

+

−

Identifier "Configured Monitor"

+

EndSection

EndSection

+

}}

−

Section "Screen"

−

Identifier "Default Screen"

−

Monitor "Configured Monitor"

−

Device "Configured Video Device"

−

-> SubSection "Display"

−

-> Virtual 3600 1200

−

-> EndSubSection

−

EndSection

−

−

Section "Device"

−

Identifier "Configured Video Device"

−

EndSection

−

</pre>

About the numbers: DELL on the left and Samsung on the right. So the virtual width is of sum of both LCD width 3600=1920+1680; Height then is figured as the max of them, which is max(1200,1050)=1200. If you put one LCD above the other, use this calculation instead: (max(width1, width2), height1+height2).

About the numbers: DELL on the left and Samsung on the right. So the virtual width is of sum of both LCD width 3600=1920+1680; Height then is figured as the max of them, which is max(1200,1050)=1200. If you put one LCD above the other, use this calculation instead: (max(width1, width2), height1+height2).

==== Use cvt/xrandr tool to add the highest mode the LCD can do ====

==== Use cvt/xrandr tool to add the highest mode the LCD can do ====

+

The actual order was different, as I tried to add new mode to one LCD at a time. Below is the combined/all-in-one quote

The actual order was different, as I tried to add new mode to one LCD at a time. Below is the combined/all-in-one quote

If you are using a VNC server that supports xrandr you can change the vnc resolution on the fly by using "xrandr -s <width>x<height>". tigervnc is an example of a client that supports xrandr

+

+

Example:

+

+

xrandr -s 1920x1200

+

+

After you VNC in, if you open a console and type "xrandr" you will get a list of currently configured modes. Each of these modes can be activated with the xrandr -s option; however, if the mode you want does not exist in the list, you can add it by doing the following:

+

+

Example: Say I want to add 1024x600 (a common netbook resolution)

+

+

First run CVT to get the correct modeline for the resolution you want to add

Doing the above will give you the ability to change to 1024x600 by typing xrandr -s 1024x600, but it will only last for the current x session. To insure that you can use the newly added resolution each time you start vncserver, add the following to ~/.vnc/xstartup

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

xrandr --output LVDS --mode 1024x768 --rate 75

Note: Changes you make using xrandr only last through the current session. xrandr has a lot more capabilities - see man xrandr for details.

Adding undetected resolutions

Due to buggy hardware or drivers, your monitor's correct resolutions may not always be detected by xrandr. For example, the EDID data block queried from the monitor may be incorrect. However, we can add the desired resolutions to xrandr.

First we run gtf or cvt to get the Modeline for the resolution we want:

For some LCD screens (samsung 2343NW), the command "cvt -r" (= with reduced blanking) is to be used.

LXrandR

Troubleshooting

Resolution lower than expected

Try this first

If you video card is recognized but the resolution is lower than you expect, you may try this.

Background: ATI X1550 based video card and two LCD monitors DELL 2408(up to 1920x1200) and Samsung 206BW(up to 1680x1050). Upon first login after installation, the resolution default to 1152x864. xrandr does not list any resolution higher than 1152x864. You may want to try editing /etc/X11/xorg.conf, add a section about virtual screen, logout, login and see if this helps. If not then read on.

About the numbers: DELL on the left and Samsung on the right. So the virtual width is of sum of both LCD width 3600=1920+1680; Height then is figured as the max of them, which is max(1200,1050)=1200. If you put one LCD above the other, use this calculation instead: (max(width1, width2), height1+height2).

Use cvt/xrandr tool to add the highest mode the LCD can do

The actual order was different, as I tried to add new mode to one LCD at a time. Below is the combined/all-in-one quote

Using xrandr with VNC

If you are using a VNC server that supports xrandr you can change the vnc resolution on the fly by using "xrandr -s <width>x<height>". tigervnc is an example of a client that supports xrandr

Example:

xrandr -s 1920x1200

After you VNC in, if you open a console and type "xrandr" you will get a list of currently configured modes. Each of these modes can be activated with the xrandr -s option; however, if the mode you want does not exist in the list, you can add it by doing the following:

Example: Say I want to add 1024x600 (a common netbook resolution)

First run CVT to get the correct modeline for the resolution you want to add

Doing the above will give you the ability to change to 1024x600 by typing xrandr -s 1024x600, but it will only last for the current x session. To insure that you can use the newly added resolution each time you start vncserver, add the following to ~/.vnc/xstartup