Config

Differences between revisions 41 and 43 (spanning 2 versions)
Revision 41 as of 2008-10-31 11:16:26
Size: 16613
Editor: 217
Comment:
Revision 43 as of 2008-11-05 01:15:15
Size: 1066
Editor: c-67-168-233-128
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
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. 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 5:
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. And that is what this page is for. However, sometimes you need to muck with the configuration manually, beyond what these tools allow. These pages are written for you.
Line 7: Line 7:
= Display Configuration = = Contents =
Line 9: Line 9:
== Setting up dual-screen using XRandR 1.2 ==

If you have an ATI, Intel, or Nvidia video card with multiple outputs (such as a VGA + DVI) or a laptop with a secondary output port 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 (or run {{{gnome-display-properties}}}). 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.

In '''Ubuntu 8.04''' and earlier, there is unfortunately still one manual configuration step required to create dual-screen layouts, 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:

{{{
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 a large but still conceivable value may result in an inability to use hardware acceleration on some cards.

== Adding undetected resolutions ==

Due to buggy hardware or drivers, your monitor's correct resolutions may not always be detected. To fix this, run {{{gksudo gedit /etc/X11/xorg.conf}}}, and find the {{{Screen}}} section. Add a {{{Display}}} subsection like this, adding the resolutions that you need.

{{{
Section "Screen"
        Identifier "Default Screen"
        Monitor "Configured Monitor"
        Device "Configured Video Device"
        SubSection "Display"
                Modes "1280x1024" "1024x768" "640x480"
        EndSubSection
EndSection
}}}

== Manual XRandR 1.2 Configuration ==

One can also manually set up a multi-monitor configuration 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 8.04:

{{{
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

Section "Device"
        Identifier "Configured Video Device"
        BusID "PCI:1:0:0"
        Option "Monitor-VGA-0" "Left Monitor"
        Option "Monitor-DVI-0" "Right Monitor"
EndSection

Section "Monitor"
        Identifier "Left Monitor"
EndSection

Section "Monitor"
        Identifier "Right Monitor"
        Option "Right Of" "Left Monitor"
EndSection

Section "Screen"
        Identifier "Default Screen"
        Device "Configured Video Device"
        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"
EndSection
}}}

There are three important things to note that you may have to alter.

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.

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+1920) x 1200 = 3840 x 1200.

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 entirely different. Look at the output of {{{xrandr}}} to see what name your graphics driver uses.

As with the GNOME XRandR configuration method, setting {{{Virtual}}} to too large a value may result in a loss of hardware acceleration, and thus an inability to use Compiz and its desktop effects.

== Enabling displayconfig-gtk (Xinerama only) ==

Ubuntu 7.10 and 8.04 provide this older X display configuration tool. Be aware that it can mess up your {{{xorg.conf}}} file, so if you use it be sure to back up your {{{xorg.conf}}} first!

It can either be run from the command line, or enabled in the menus via System > Preferences > Main Menu / Applications > Other and make sure the "Screens and Graphics" box is checked. It can then be found at Applications > Other > Screens and Graphics.


== 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 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
}}}


= Input Configuration =

Ubuntu 8.04 and later include a new version of Xorg which support input-hotplug. With this new functionality, it's likely that you won't need to do any configuration at all to make your devices work, assuming they're recognized and set up by the kernel. However, if you do need to do adjust things, read on.

== Dynamic Input Configuration with xinput ==

The {{{xinput}}} command line tool can be used for some on-the-fly configuration adjustments. Ubuntu 8.04 users will first need to install {{{xinput}}} from {{{universe}}}.

To view a listing of the input devices X sees, run:

{{{
$ xinput list
...
"Configured Mouse" id=2 [XExtensionPointer]
 Num_buttons is 9
 Num_axes is 2
 Mode is Relative
 Motion_buffer is 256
 Axis 0 :
  Min_value is -1
  Max_value is -1
  Resolution is 1
 Axis 1 :
  Min_value is -1
  Max_value is -1
  Resolution is 1
"Generic Keyboard" id=3 [XExtensionKeyboard]
 Num_keys is 248
 Min_keycode is 8
 Max_keycode is 255
}}}

Individual devices can be queried for more details:

{{{
$ xinput query-state "Configured Mouse"
2 classes :
ButtonClass
 button[1]=up
 button[2]=up
 button[3]=up
 button[4]=up
 button[5]=up
 button[6]=up
 button[7]=up
 button[8]=up
 button[9]=up
ValuatorClass Mode=Relative Proximity=In
 valuator[0]=3182
 valuator[1]=969
}}}

If you have multiple mouse devices installed, you can switch which is considered the core pointer like this:

{{{
$ xinput set-pointer "Configured Mouse"
}}}

{{{xinput}}} can also be used to alter the button mappings on mice and adjust the acceleration and feedback settings.

In '''Ubuntu 8.10''' and later, different input drivers may also expose arbitrary properties for applications to set. Synaptics touchpads are particularly configurable like this, but other devices have some more general properties.

{{{
$ xinput list-props "SynPS/2 Synaptics TouchPad"
Device 'SynPS/2 Synaptics TouchPad':
 Device Enabled: 1
 Synaptics Edges: 1632, 5312, 1575, 4281
 Synaptics Finger: 25, 30, 256
 Synaptics Tap Time: 180
 Synaptics Tap Move: 220
 Synaptics Tap Durations: 180, 180, 100
 Synaptics Tap FastTap: 0
[...]

$ xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 0
$ xinput list-props "SynPS/2 Synaptics TouchPad"
Device 'SynPS/2 Synaptics TouchPad':
 Device Enabled: 0
 Synaptics Edges: 1632, 5312, 1575, 4281
 Synaptics Finger: 25, 30, 256
 Synaptics Tap Time: 180
 Synaptics Tap Move: 220
 Synaptics Tap Durations: 180, 180, 100
 Synaptics Tap FastTap: 0
[...]
}}}

<<Anchor(hal)>>
== Input Configuration with HAL ==

Beginning with Ubuntu 8.10, input device configuration is done through HAL rather than in your {{{xorg.conf}}}. The syntax for HAL {{{fdi}}} files is a bit different than {{{xorg.conf}}}, and editing XML is only marginally better than editing {{{xorg.conf}}}... but on the plus side configuration changes don't require an X restart - just replugging of the device.

Essentially, to configure a device, add a new {{{fdi}}} file for it to your {{{/etc/hal/fdi/policy}}} directory. You will then need to replug the device or log out and in again for the changes to take effect.

For example, use this sort of {{{fdi}}} file to set Synaptics touchpad options (see the {{{synaptics}}} manpage for possible options, or [[https://help.ubuntu.com/community/SynapticsTouchpad|the Synaptics documentation]] for other methods):

{{{
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
 <device>
  <match key="input.x11_driver" string="synaptics">
   <merge key="input.x11_options.VertTwoFingerScroll" type="string">true</merge>
   <merge key="input.x11_options.HorizTwoFingerScroll" type="string">true</merge>
  </match>
 </device>
</deviceinfo>
}}}

The '''match''' elements are used to conditionally match on various attributes related to the device or system. In this case we apply these settings to any device using the {{{synaptics}}} (ie. touchpad) driver.
The '''append''' elements are used to add parameters to various options. Options previously put in {{{xorg.conf}}} can be set using {{{input.x11_options.<option-name> (string)}}}.

Here is an example {{{fdi}}} file for setting up keys on a Dell Precision M20:

{{{
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" prefix="Precision">
      <match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" contains="M20">
        <append key="input.keymap.data" type="strlist">e005:brightnessdown</append> <!-- Fn+Down arrow Brightness Down -->
        <append key="input.keymap.data" type="strlist">e006:brightnessup</append> <!-- Fn+Up arrow Brightness Up -->
        <append key="input.keymap.data" type="strlist">e007:battery</append> <!-- Fn+F3 battery icon -->
        <append key="input.keymap.data" type="strlist">e008:wlan</append> <!-- Fn+F2 Turn On/Off Wireless -->
        <append key="input.keymap.data" type="strlist">e009:ejectclosecd</append> <!-- Fn+F10 Eject CD -->
        <append key="input.keymap.data" type="strlist">e00a:suspend</append> <!-- Fn+F1 hibernate -->
        <append key="input.keymap.data" type="strlist">e00b:displaytoggle</append> <!-- Fn+F8 CRT/LCD -->
        <append key="info.capabilities" type="strlist">input.keymap</append>
      </match>
    </match>
  </device>
</deviceinfo>
}}}

These '''match''' elements are used to match on the system's product name, to check that it starts with "Precision" and contains "M20". In this case, we're appending some {{{[key]:[function]}}} pairs to the {{{input.keymap.data}}} option.

As a contrived example, let's say you wanted to specify the dvorak-intl variant and configure the eurosign to the E key:

{{{
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.keys">
      <merge key="input.xkb.variant" type="string">dvorak-intl</merge>
      <merge key="input.xkb.options" type="string">eurosign:e</merge>
    </match>
  </device>
</deviceinfo>
}}}

An example of configuring for the Logitech MX1000 USB mouse:

{{{
<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
 <device>
  <match key="info.capabilities" contains="input.mouse">
   <merge key="input.x11_driver" type="string">mouse</merge>

    <!-- Logitech tweaks -->
    <match key="@input.originating_device:usb.vendor_id" int="0x46d">
     <match key="@input.originating_device:usb.product_id" int_outof="0xc50e;0xc518">
      <merge key="input.x11_options.RelHWHEELOptions" type="string">invert</merge>
     </match>
    </match>

   </match>
  </match>
 </device>
</deviceinfo>
}}}

The {{{vendor_id}}} and {{{product_id}}} values can be found via

{{{
$ cat /proc/bus/input/devices
}}}

== Contributed Documentation ==

The following documentation was provided by various people in the past. Generally, much of it was written for pre-InputHotplug X, so may or may not still work in Intrepid.

Keyboard Config
 * [[https://help.ubuntu.com/community/MultimediaKeys|General Multimedia keyboard]]
 * [[https://wiki.ubuntu.com/USBKeyboardInstall|USB keyboard]]
 * [[https://help.ubuntu.com/community/AppleKeyboard|Apple Keyboard]]
 * [[https://help.ubuntu.com/community/MicrosoftNaturalErgonomicKeyboard4000|Microsoft Natural Ergonomic 4000 keyboard]] - Probably obsolete
 * [[https://help.ubuntu.com/community/LogitechG15|Logitech G15 keyboard]] - Probably obsolete

Mouse Config
 * [[https://help.ubuntu.com/community/ManyButtonsMouseHowto|General Multi-Button mouse]]
 * [[https://help.ubuntu.com/community/BluetoothInputDevices|Bluetooth input devices]]
 * [[https://help.ubuntu.com/community/IntellimouseMousemanBackForwardButtons|Intellimouse Mouseman buttons]] - Probably obsolete
 * [[https://help.ubuntu.com/community/MX1000Mouse|Logitech MX1000 mouse]]
 * [[https://help.ubuntu.com/community/G7Mouse|Logitech G7 mouse]]
 * [[https://help.ubuntu.com/community/Logitech_MX610|Logitech MX610 mouse]]
 * [[https://help.ubuntu.com/community/RazerCopperHeadMouse|Razer CopperHead mouse]]
 * [[https://help.ubuntu.com/community/SerialMouseHowto|Serial mouse]]
 * [[https://help.ubuntu.com/community/Logitech_Marblemouse_USB|Logitech Marble Mouse USB - hal fdi policy for Intrepid]]

Tablet Config
 * [[https://help.ubuntu.com/community/TabletSetup|Tablets]]
 * [[https://help.ubuntu.com/community/Wacom|Wacom tablet]]
 * [[https://help.ubuntu.com/community/WacomTroubleshooting|Wacom tablet troubleshooting]]
 * [[https://help.ubuntu.com/community/AiptekTablet|Aiptek tablets]]
 * [[https://help.ubuntu.com/community/TabletSetupWizardpen|Wizardpen]]

Touchpad Config
 * [[https://help.ubuntu.com/community/SynapticsTouchpad|Synaptics touchpad]]
 * [[https://help.ubuntu.com/community/SynapticsTouchpad/AppleIbookG4|Apple iBook G4 touchpad]]
 * [[https://wiki.ubuntu.com/MacBook/SantaRosa#Touchpad%20(appletouch)|Apple Macbook touchpad on Ubuntu 8.10 (Intrepid)]]
 * [[https://wiki.ubuntu.com/DebuggingTouchpadDetection|Debugging touchpad detection]]

Game Controller Config
 * [[https://help.ubuntu.com/community/CWiiD|Wii Remote game controller]]
 * [[X/Config/Input|Input device configuration]]
 * [[X/Config/Resolution|Display resolution configuration]]
 * [[X/Config/Multihead|Multihead configuration]]
 * [[X/Config/SVideo|SVideo configuration]]

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. These pages are written for you.

Contents

References

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