Config

Differences between revisions 7 and 69 (spanning 62 versions)
Revision 7 as of 2008-04-29 17:47:41
Size: 6103
Editor: c-67-168-235-241
Comment:
Revision 69 as of 2020-10-13 09:10:05
Size: 2749
Editor: yktooo
Comment: Remove outdated text/remark about 10.04
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Once upon a time, long long ago, Linux users had to manually configure their X Window System in order to use graphical programs. Then came Linux distributions which provided install scripts that (most of the time) created a basic configuration file for the user, that they could then customize. Today, we are transitioning towards a "config-less" X, that figures out everything those install scripts used to, but all inside X itself. #title X Configuration
<<Include(X/MenuBar)>>
Line 3: Line 4:
Of course, such a transition is not without some rough patches, and it's possible users may find themselves in a spot where they may still need to do some manual configuration in {{{/etc/X11/xorg.conf}}}. And that is what this page is for. Today's X rarely requires manual configuration. X now automatically configures itself with reasonable defaults. Both GNOME and KDE provide GUI utilities for customizing settings beyond these defaults if you like.
Line 5: Line 6:
= Display Configuration = However, sometimes you need to muck with the configuration manually, beyond what these tools allow.
Line 7: Line 8:
== Setting up dual-screen in xorg.conf using XRandR 1.2 == == Quick xorg.conf ==
Line 9: Line 10:
If you have an ATI, Intel, or Nvidia video card with two outputs (such as a VGA + DVI) you can set up a dual screen configuration using the ''X Resize, Rotate and Reflection Extension'' (''XRandR 1.2'').

The easiest way to do this is using the ''Screen Resolution'' GNOME applet under System > Preferences. This tool doesn't modify your xorg.conf, but rather applies the changes dynamically during GNOME startup. To customize your dual-head setup, simply drag and drop where you want your displays.

Unfortunately, for creating dual-screen layouts there is still one manual configuration step required, which is to add a Virtual framebuffer size. The size needs to be equal or greater than the maximum combined size of your displays. For example, if you have two 1920x1200 monitors you wish to put side-by-side, you would add a Virtual line like this:
Most systems don't ship with an X config file any more, but sometimes you need one. Here's a basic skeleton:
Line 16: Line 13:
Section "Screen"
        Identifier "Default Screen"
        Device "Configured Video Device"
        DefaultDepth 24
        SubSection "Display"
            Depth 24
            Virtual 3840 1200
        EndSubSection
EndSection
}}}

Note that setting Virtual to larger than 2048x2048 disables 3d acceleration (i.e., no Compiz). This is why the default maximum is set to 2048x2048 and why it requires manual configuration to increase. A new memory management system (TTM) is being worked on to make this setting dynamic; see New DRM / TTM in [X/KernelWishlist] for details.

=== Manual Configuration ===

An alternative is to set it up manually in {{{xorg.conf}}}. You might want to do this if you're not running GNOME, or if you want it to take effect earlier on in the bootup sequence, or if you want to trick things out beyond what the GUI tool is capable of.

Here is an example {{{xorg.conf}}} setting up dual-head with XRandR in Ubuntu Hardy:

{{{
Section "InputDevice"
        Identifier "Generic Keyboard"
        Driver "kbd"
        Option "XkbRules" "xorg"
        Option "XkbModel" "pc105"
        Option "XkbLayout" "us"
        Option "XkbOptions" "lv3:ralt_switch"
EndSection

Section "InputDevice"
        Identifier "Configured Mouse"
        Driver "mouse"
        Option "CorePointer"
        Option "Emulate3Buttons" "true"
EndSection
Line 54: Line 15:
        BusID "PCI:1:0:0"
        Option "Monitor-VGA-0" "Left Monitor"
        Option "Monitor-DVI-0" "Right Monitor"
Line 60: Line 18:
        Identifier "Left Monitor"
EndSection

Section "Monitor"
        Identifier "Right Monitor"
        Option "Right Of" "Left Monitor"
        Identifier "Configured Monitor"
Line 70: Line 23:
        Monitor "Configured Monitor"
Line 71: Line 25:
        DefaultDepth 24
        SubSection "Display"
            Depth 24
            Virtual 3840 1200
        EndSubSection
EndSection

Section "ServerLayout"
        Identifier "Default Layout"
        Screen "Default Screen"
        InputDevice "Generic Keyboard"
        InputDevice "Configured Mouse"
Line 86: Line 28:
There are three important things to note that you may have to alter. == Configuring using xorg.conf.d (Ubuntu 10.04 and newer) ==
Line 88: Line 30:
The first is the '''BusID'''; look at the output of {{{lspci | grep VGA}}} to see what Bus ID your video card is on. You may even be able to omit this entirely. Files ending in *.conf in the {{{/usr/share/X11/xorg.conf.d}}} directory are automatically loaded by X at start prior to reading the xorg.conf. These files can each contain one or more Sections in the same format used by {{{xorg.conf}}}.
Line 90: Line 32:
The second is the '''Virtual''' setting in the Display SubSection. In general, this should be set to the ''total size'' of your combined screen. So if you have two 1920x1200 monitors you plan to put side by side, this would be (1920*2) x 1200 = 3840 x 1200. Users can continue making custom configuration in /etc/xorg.conf as usual; the .conf snippets are mainly there for the distro or hw vendor to ship default InputClass rules and custom overrides.
Line 92: Line 34:
The third is the name of your device's '''output name'''. In the above, it is "Monitor-VGA-0", but it could be "Monitor-VGA0" or something. Look at the output of {{{xrandr}}} to see what name your graphics driver uses. == Configuration Recipes ==
Line 94: Line 36:
One important note: X has a limitation on Virtual size for 3D acceleration. If you set Virtual to larger than 2048x2048, you won't be able to use 3D acceleration - which means no Compiz Desktop Effects. So you may have to trade off between having vast expanses of screen real estate, vs. having nifty 3D effects. General Configuration
 * [[X/Config/SessionStartup|Session Startup]] - .xprofile, .xsessionrc, .gnomerc
 * [[X/Rootless|Rootless X]] - Running X as a user process, not as the root user
 * [[https://launchpad.net/~xorg-edgers|Xorg On The Edge]] - for bleeding edge packages
 * [[X/Config/Input|Input device configuration]]
 * [[X/Config/Keyboard|Keyboard configuration]]

Display Configuration
   * [[X/Config/Resolution|Display resolution configuration]]
   * [[X/Config/Multihead|Multihead configuration]]
   * [[X/Config/SVideo|SVideo configuration]]
   * [[X/Config/HDMI|HDMI configuration]]
   * [[https://help.ubuntu.com/community/BinaryDriverHowto|Binary Driver Howto]]
   * [[https://help.ubuntu.com/community/HybridGraphics|Hybrid Graphics Howto]]
   * [[https://wiki.ubuntu.com/X/Config/HybridGraphics|Hybrid Graphics (12.04.3 or >=13.10)]]
Line 97: Line 53:
== Setting up S-Video ==

Most drivers aren't able to correctly detect when stuff is attached to the S-Video port, so to avoid problems it's shipped off by default for most cases. There's several ways to enable it:

'''Option A.''' Turn load detection back on:
{{{
xrandr --output S-video --set load_detection 1
}}}

'''Option B.''' To turn load detection back on permanently in xorg.conf so it persists between reboots, add this to your xorg.conf:
{{{
# /etc/X11/xorg.conf
Section "Device"
        ...
        Option "TVDACLoadDetect" "TRUE"
EndSection
}}}

'''Option C.''' Force S-Video on:
{{{
xrandr --addmode S-video 800x600
}}}


= References =
== Other Resources ==
Line 126: Line 58:
 * http://www.intellinuxgraphics.org/dualhead.html  * http://www.intellinuxgraphics.org/dualhead.html [dead link]
Line 128: Line 60:
 * http://en.opensuse.org/GNOME/Multiscreen
 * https://wiki.debian.org/XStrikeForce/InputHotplugGuide
 * https://help.ubuntu.com/community/MultimediaKeys
----
CategoryXTeam<<BR>>

Today's X rarely requires manual configuration. X now automatically configures itself with reasonable defaults. Both GNOME and KDE provide GUI utilities for customizing settings beyond these defaults if you like.

However, sometimes you need to muck with the configuration manually, beyond what these tools allow.

Quick xorg.conf

Most systems don't ship with an X config file any more, but sometimes you need one. Here's a basic skeleton:

Section "Device"
        Identifier      "Configured Video Device"
EndSection

Section "Monitor"
        Identifier      "Configured Monitor"
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
EndSection

Configuring using xorg.conf.d (Ubuntu 10.04 and newer)

Files ending in *.conf in the /usr/share/X11/xorg.conf.d directory are automatically loaded by X at start prior to reading the xorg.conf. These files can each contain one or more Sections in the same format used by xorg.conf.

Users can continue making custom configuration in /etc/xorg.conf as usual; the .conf snippets are mainly there for the distro or hw vendor to ship default InputClass rules and custom overrides.

Configuration Recipes

General Configuration

Display Configuration

Other Resources


CategoryXTeam

X/Config (last edited 2020-10-13 09:10:05 by yktooo)