How to write an xorg.conf file for linux
For those who don’t know what an ‘xorg.conf’ file is, it’s basically the file in Linux operating systems that tells the system what graphics card, mouse, keyboard you have, and what settings to use for them. There are a few GUIs for making these, but most of them do a terrible job, and add bloat.
My xorg.conf is clean, and therefore, easy to modify/change.
I’ve used the same xorg.conf for a long time, across 4 different machines (with very minor modifications depending on resolution required etc..)
It’ll save a lot of time to just write it once, and reuse it. All I do is install the nvidia driver and copy over my xorg.conf and reboot, and you have a perfect working system.
This file should work for any nVidia graphics card (the names of my monitor and model of graphics card are just labels and don’t matter) and will work with just the minor changes mentioned below.
If you have a laptop with nVidia graphics, and would like a perfectly configured xorg.conf for linux, you might want to just cheat and use my custom xorg.conf
Key features:
trackpad with vertical scrolling enabled.
USB connected mice will have forward and back buttons enabled in firefox.
nVidia logo at logon is removed.
Refresh rate is correctly reported as 60Hz instead of 50Hz with
Option DynamicTwinView FALSE
All required modules for Compiz Fusion to work. (no more borderless windows!)
DPMS adds Energy Star power saving functions for your monitor.
You can use any of the following (put in ServerLayout)
Option "StandbyTime" "10" Option "SuspendTime" "20" Option "OffTime" "30
You’ll just have to change your desired resolution and refresh rate (1280x800_60 in mine)
Also, note, if you’re using a desktop with multiple DVI ports, you’ll need to specify (DPF for Digital Flat Panel) under Screen
Option “metamodes” “DFP-1: nvidia-auto-select +0+0”
Anyway, here’s my xorg)
\# Xorg SyXbiT – Dell XPS m1330 w/ nVidia GeForce 8400M GS
Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0"
InputDevice "Mouse0"
InputDevice "Touchpad"
Option "OffTime" "30"
EndSection
Section "Files"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection
Section "ServerFlags"
Option "Xinerama" "0"
EndSection
Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "Buttons" "7"
Option "ButtonMapping" "1 2 3 6 7"
Option "ZAxisMapping" "4 5"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "SHMConfig" "on"
EndSection
Section "InputDevice"
Identifier "Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizEdgeScroll" "0"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Dell"
ModelName "CMO LED"
HorizSync 30.0 – 75.0
VertRefresh 60.0
# DPMS for Energy Star power saving
Option "DPMS" "TRUE"
# Fix refresh rate bug
Option "DynamicTwinView" "FALSE"
EndSection
Section "Device"
Identifier "8400M GS"
Driver "nvidia"
Option "NoLogo" "true"
VendorName "NVIDIA Corporation"
BoardName "GeForce 8400M GS"
Option "DPMS" EndSection
Section "Screen"
Identifier "Screen0"
Device "8400M GS"
Monitor "Monitor0"
DefaultDepth 24
Option "TwinView" "0"
Option "metamodes" "1280x800\_60 +0+0"
EndSection