[GLLUG] Wanting to write my own xorg.conf

Charles Ulrich charles at idealso.com
Wed May 3 10:08:27 EDT 2006


Giovanni DiMatteo wrote:
> I'm a student at Albion College, Gentoo/OpenBSD/FreeBSD triple-boot 
> user, and am REALLY frustrated with figuring out how to write my own 
> xorg.conf for Gentoo... I noticed that the GLLUG had a meeting in 
> September that discussed this very thing, and I missed out :/ .  
> 
> Does anyone have notes or a power point from that meeting?   How about 
> websites that help with this very thing, or example xorg.conf files for 
> my kind of laptop (I am on a Thinkpad R51, 2883-8QU).  Of course, I have 
> rtfm, and googled a lot, but it's not straightforward enough--I 
> especially need to know how I can get the hardware information I need 
> (horiz/vertical sync /refresh rates or w/e).
> 
> Thanks!

Once you get the hang of xorg.conf, it's not so bad. Starting out with a 
known-working configuration file is usually the best bet. If that's not 
practical/possible, you can get X to probe your hardware and generate 
one to start with. (I'm not sure off the top of my head how to do this, 
though.) Since X is mostly independent of the underlying OS, you should 
be able to use the same one, perhaps with minor tweaks, across all three 
OSes that you wish to use.

The two most important part of xorg.conf are the video driver and 
sync/refresh rates. The video driver is usually rather easy, just find 
out which video chipset you have, figure out which X driver supports it, 
and specify that in your xorg.conf. (I'll point out where below.) It 
looks like the R51 has shipped with a number of different video 
chipsets, though probably you have one of either an ATI chipset or an 
Intel chipset. Intel chipsets are no sweat, just use the 'i810' driver. 
ATI ones can be a little trickier and I've never dealt with them, so 
someone else may have to guide you along if you have one.

Refresh rates aren't too horrible either. If you have a CRT, you'll be 
able to find these in the manual or via Google. If you have an LCD (as 
I'm assuming you do with a thinkpad), they won't matter as much but 
still have to be within a certain conservative range or the video 
chipset won't like it.

Here's my xorg.conf for Gentoo. I'd recommend trying to get this to work 
in your Gentoo installation before copying it to your other OSes.



# Unless you have an odd hardware setup, this will remain
# unchanged. One keyboard, one mouse, one screen.
Section "ServerLayout"
  Identifier     "XFree86 Configured"
  Screen         0 "Screen0" 0 0
  InputDevice    "Mouse0" "CorePointer"
  InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

# This section specifies pahts to various modules, drivers, and fonts
# on the machine. You may have to tweak these for *BSD. Also note that
# I have a metric buttload of fonts installed, so delete the FontPath
# lines to fontsets that you don't have installed.
Section "Files"
     RgbPath     "/usr/lib/X11/rgb"
     ModulePath  "/usr/X11R6/lib/modules"
     FontPath    "/usr/share/fonts/misc"
     FontPath    "/usr/share/fonts/Type1"
     FontPath    "/usr/share/fonts/75dpi"
     FontPath    "/usr/share/fonts/100dpi"
     FontPath    "/usr/share/fonts/TTF"
     FontPath    "/usr/share/fonts/vc"
     FontPath    "/usr/share/fonts/urw-fonts"
     FontPath    "/usr/share/fonts/sharefonts"
     FontPath    "/usr/share/fonts/lfpfonts-var"
     FontPath    "/usr/share/fonts/lfp-fix"
     FontPath    "/usr/share/fonts/intlfonts"
     FontPath    "/usr/local/share/fonts"
     FontPath    "/usr/share/fonts"
     FontPath    "/usr/share/fonts/corefonts"
     FontPath    "/usr/share/fonts/default"
     FontPath    "/usr/share/fonts/local"
     FontPath    "/usr/share/fonts/default/ghostscript"
EndSection

# These load modules for various xorg functionality. Generally, you want
# these unless otherwise noted.
Section "Module"
  Load  "dbe"
  # dri: Only for 3D acceleration via Linux kernel drivers
  Load  "dri"
  Load  "extmod"
  # glx: Only for OpenGL 3D acceleration
  Load  "glx"
  Load  "record"
  Load  "xtrap"
  Load  "type1"
  Load  "freetype"
EndSection

# These settings should work fine for almost every keyboard.
Section "InputDevice"
  Identifier  "Keyboard0"
  Driver      "kbd"
  Option     "XkbModel" "pc104"
  Option     "XkbLayout" "us"
  Option      "1 2 3"
  Option      "AutoRepeat" "250 30"
EndSection

# These settings are for your average 2-button mouse with scrollwheel.
# (The scrollwheel counts as a third button when depressed and each
# direction that the scrollwheel moves is counted as a button, hence 5
# buttons total.) You will probably have to change the Device for *BSD.
# If you have a trackpad or pointer stick thing, these settings should
# still work, but you'll have the extra functionality when you plug in
# an external mouse. The Emulate3Buttons option allows you to click the
# 1st and 2nd buttons at the same time to emulate a 3rd-button
# (middle-button) click.
Section "InputDevice"
  Identifier  "Mouse0"
  Driver      "mouse"
  Option     "Protocol" "Auto"
  Option     "Device" "/dev/input/mice"
  Option      "Buttons" "5"
  Option      "ZAxisMapping" "4 5"
  Option      "Emulate3Buttons" "true"
EndSection

# Ah, the fun part. VendorName and ModelName are free-form strings. They
# only help humans identify the monitor, so they are not critical to a
# working xorg.conf. The HorizSync and VertRefresh settings, however,
# usually are. These ranges *should* work for most LCD panels. If not,
# try to narrow the VertRefresh range to 50-60 or copy and paste from
# someone else's R51 xorg.conf.
Section "Monitor"
  Identifier   "Monitor0"
  VendorName   "Monitor Vendor"
  ModelName    "Monitor Model 1234"
  HorizSync   31.5 - 64.3
  VertRefresh 50 - 75
  Option     "DPMS"
EndSection

# Settings for your video card. The Driver setting is the most
# important. Here, I've assumed that you have a recent Intel chipset.
# The driver may support additional useful options, see the xorg
# documentation.
Section "Device"
  Identifier  "Card0"
  Driver      "i810"
  VendorName  "Intel Corporation"
EndSection

# Another interesting section. This one ties together your video card
# and monitor into a Screen and tells xorg what the combination of the
# two can support. Here, we have three Display subsections, each
# with different bit-depths and a variety of resultions. This comes in
# useful if you have a video card that can do really high resolutions at
# a low bit-depth but lower resolutions at a higher bit-depth.
#
# With modern video cards in combination with LCD panels, you generally
# only need to specify the depth that you want (almost always 24) along
# with the native resolution of the LCD panel. So, if you only ever
# wanted 24-bit color at 1024x768, you would *only* include the
# SubSection that I've commented out and delete the others.
Section "Screen"
  Identifier "Screen0"
  Device     "Card0"
  Monitor    "Monitor0"
  # This is the depth that xorg will try to use by default. You can have
  # it use others by passing an argument to startx. I don't remember the
  # syntax at the moment.
  DefaultDepth 24

  SubSection "Display"
   Depth     8
   Modes "1280x1024" "1024x768" "800x600" "640x480"
  EndSubSection

  SubSection "Display"
   Depth     16
   Modes "1280x1024" "1024x768" "800x600" "640x480"
  EndSubSection

  SubSection "Display"
   Depth     24
   Modes "1280x1024" "1024x768" "800x600" "640x480"
  EndSubSection

  # SubSection "Display"
  #  Depth     24
  #  Modes "1024x768"
  # EndSubSection

EndSection



Hope this helps, let me know if you have any questions.
-- 
Charles Ulrich
Ideal Solution, LLC -- http://www.idealso.com


More information about the linux-user mailing list