Configure X

From gr0x0rd
Jump to navigation Jump to search

The next thing you'll probably want is a graphical user interface, which is what most people are comfortable with. So let's being emerging xwindows, which will provide a framework you can extend with a desktop manager. Before you begin, make sure that the following configurations have been set in your make.conf.

Xorg will pull in the video drivers for whatever you have specified for the VIDEO_CARDS value in this same file. If you are electing to use the nvidia closed-source drivers, be sure to build them with the gtk USE flag in order to install a useful graphical driver settings utility.

If you are installing Gentoo onto a laptop with a synaptics touchpad, you may also want to include synaptics as one of the values for the INPUT_DEVICES setting.

# xorg settings
VIDEO_CARDS="nvidia"   # for nvidia, closed source
INPUT_DEVICES="evdev synaptics"
ABI_X86="64 32"

Gentoo have a Xorg guide that you should likely have a look at as well.

$ sudo emerge -av xorg-drivers xorg-server

There should be a lot of packages that get installed with X, so feel free to go have a coffee. After the emerge has finished, we now need to configure xorg. First, lets update our environment.

$ sudo env-update && source /etc/profile

In a perfect world, X will work without any configuration settings. Sadly the world isn't often perfect, so you may need to edit your /etc/X11/xorg.conf file manually.

$ sudo nano -w /etc/X11/xorg.conf

/etc/X11/xorg.conf

This file is an example dual-display configuration using nvidia's proprietary closed-source drivers.

###################################################
#
# gr0x0rd's xorg.conf
#
###################################################

Section "ServerLayout"
    Identifier     "TVOut"
    Screen      0  "Screen0" 0 0
    Screen      1  "Screen1" RightOf "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Module"
    SubSection     "extmod"
        Option         "omit xfree86-dga"
    EndSubSection
    Load           "dbe"
    Load           "vbe"
    Load           "GLcore"
    Load           "extmod"
    Load           "glx"
    Load           "bitmap"
    Load           "speedo"
    Load           "record"
    Disable        "dri"
    Disable        "dri2"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "InputDevice"
    # generated from data in "/etc/conf.d/gpm"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "Monitor"
    Identifier     "Dell LCD"
    VendorName     "Dell"
    ModelName      "DELL E196FP"
    HorizSync       31.5 - 31.5
    VertRefresh     60.0
EndSection

Section "Monitor"
    Identifier     "TV"
    VendorName     "Sony"
    ModelName      "Bravia"
    Option         "DPMS" "true"
    Option         "DPI" "96 x 96"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "SONY TV"
    HorizSync       15.0 - 70.0
    VertRefresh     58.0 - 62.0
EndSection

Section "Monitor"
    Identifier     "Monitor1"
    VendorName     "Unknown"
    ModelName      "DELL E196FP"
    HorizSync       31.0 - 83.0
    VertRefresh     56.0 - 75.0
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 260"
    Option         "UseEvents" "true"
    Option         "RenderAccel" "false"
    BusID          "PCI:1:0:0"
    Screen          0
EndSection

Section "Device"
    Identifier     "Device1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 260"
    Option         "UseEvents" "true"
    Option         "RenderAccel" "false"
    BusID          "PCI:1:0:0"
    Screen          1
EndSection

Section "Screen"
    Identifier     "TV Screen"
    Device         "Device0"
    Monitor        "TV"
EndSection

Section "Screen"
    Identifier     "LCD Screen"
    Device         "Device1"
    Monitor        "Dell LCD"
    DefaultDepth    24
    SubSection     "Display"
        Viewport    0 0
        Depth       24
        Modes      "1280x1024"
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "TwinViewXineramaInfoOrder" "DFP-0"
    Option         "metamodes" "DFP: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Screen"
    Identifier     "Screen1"
    Device         "Device1"
    Monitor        "Monitor1"
    DefaultDepth    24
    Option         "TwinView" "0"
    Option         "metamodes" "CRT: nvidia-auto-select +0+0"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "Composite" "Enable"
    Option         "RENDER" "Enable"
    Option         "DAMAGE" "Enable"
EndSection