Xorg/Multiple monitors

This page describes the setup of multiple monitors under Xorg. Multihead support in X has luckily progressed in recent versions, so it is pretty easy to set up. Usually it is as simple as defining monitors in Xorg configuration files.

USE flags
Be aware, most desktop environments and graphical toolkit require the  USE flag to be enabled. When preparing to add a second monitor to the system, be sure to add this flag to :

Emerge
Next rebuild the @world set.

Simple
The basic procedure is defining one "Monitor" section per Monitor and then tying everything together in a "Device" section that specifies the video chip driving the monitor(s). For the following examples, Xorg's configuration is presumed to be stored in (no  file will be used). Alternatively, if the user desires, all files defined in the folder can be combined together to form an. The following example is the basic version for two monitors of the same resolution.

Each "Monitor" section must contain an Identifier, everything else is optional. The identifier may be freely chosen. The placement of the monitors is done relatively with one of the keywords,  ,  , or. Additionally there is a  keyword for fancy cases, however this article avoids using it. Each monitor can receive custom options (e.g. resolution) in its configuration.

Next the monitors need to be mapped to the outputs. This is done in the  section describing the video chip and driver. The Device section of the two monitor example (using an Intel video card) would look like the following.

The names of the monitors are in the form "Monitor- ". The port each monitor was on was determined by running the xrandr -q command. This should be everything needed for a basic setup.

More complex cases
Sometimes more complex layouts will be needed. A third example of a monitor file, with resolution options could look like the following.

It is possible to see in the example above that manufacturer names can be used to get a single config file attached to a single device.

Next a more complete example of the video configuration for package will be provided:

The following was made for the radeon driver. Notice the change of the video output name on the same laptop.

Different resolutions
Xrandr-1.3 is a little deficient in this regard. X can precisely probe the screen devices, but xrandr will get/display the minimum resolution fitted to the smallest screen attached to the machine. This is annoying because it creates a debug situation. has to be read in order to get possible monitor resolutions, define a few modes with xrandr, and then choose a video mode with xrandr. There is nothing user friendly about the process. The process usually takes matter of minutes, but is annoying when a user desires to attach a bigger screen to a computer for a simple event like watching a movie. The latter can be achieved, somewhat, with the following example.

Troubleshooting
Bug: Anyone can notice the level of fine probing X server does (or rather ). Numerous handy details are provided (numerous screen resolutions, gamma values, and other obscure values). One can pick any defined video mode on the list and X server display it. Now, whenever anyone desires to change the video mode of a particular display xrandr will complain about non-existant modes. What? The video modes vanished somewhere? The only that remain are the ones that can fit to the biggest resolution on the smallest display. To get more video modes copy/paste some preferred video modes like in the example above.