# Help building proper Xorg.conf



## Wiched (Oct 23, 2011)

For the moment I have two problems with my xorg:

1. The mouse wheel doesn't work (it works as third button but the scrolling doesn't work)
2. The refresh rate of the monitor for 1280x1024is too low (50khz)

I really appreciate your help. 



```
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 280.13  (root@boyana)  Sun Oct 23 02:42:22 UTC 2011


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    FontPath        "/usr/local/lib/X11/fonts/misc/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/:unscaled"
    FontPath        "/usr/local/lib/X11/fonts/misc/"
    FontPath        "/usr/local/lib/X11/fonts/Type1/"
    FontPath        "/usr/local/lib/X11/fonts/100dpi/"
    FontPath        "/usr/local/lib/X11/fonts/75dpi/"
    FontPath        "/usr/local/lib/X11/fonts/cyrillic/"
    FontPath        "/usr/local/lib/X11/fonts/TTF/"
    FontPath         "/usr/local/lib/X11/fonts/webfonts/"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/sysmouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5 6 7"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "keyboard"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       61 - 81
    VertRefresh     56 - 75
    Option         "DPMS"
#1280x1024 @ 60.00 Hz (GTF) hsync: 63.30 kHz; pclk: 108.88 MHz
        Modeline "1280x1024_75.00"  108.88  1280 1360 1496 1712  1024 1025 1028 
1060  -Hsync +Vsync
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "UseEdidDpi" "True"
    Option         "ConstantDPI" "True"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
Section "Module"
    Load           "i2c"
    Load           "bitmap"
    Load           "ddc"
    Load           "extmod"
    Load           "freetype"
    Load           "glx"
    Load           "int10"
    Load           "type1"
    Load           "vbe"
EndSection
```


----------



## wblock@ (Oct 23, 2011)

Avoid Modelines.  Most monitors automatically report available modes with DDC or EDID.  If this one does not, put the desired resolution in the Screen section and add VertRefresh and HorizSync settings to the Monitor section.


----------



## Wiched (Oct 23, 2011)

I tried adding in the Screen section


```
Option         "metamodes" "1280x1024_75 +0+0; nvidia-auto-select +0+0"
```
but it didn't work at all.


----------



## aragon (Oct 23, 2011)

Wiched said:
			
		

> 1. The mouse wheel doesn't work (it works as third button but the scrolling doesn't work)


Are you sure you need that ZAxisMapping directive?  Try remove it, and if scrolling still doesn't work, use x11/xev to troubleshoot what button events your wheel is triggering, and remap them appropriately (scrolling uses buttons 4 and 5).


----------



## wblock@ (Oct 24, 2011)

Wiched said:
			
		

> I tried adding in the Screen section
> 
> 
> ```
> ...



First, remove or comment out all mention of modes.  Try it that way.

If that doesn't work, put a Modes entry in the Screen section:

```
Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Modes "1280x1024"
        EndSubSection
EndSection
```


----------



## shaman (Jan 6, 2012)

Try:
`# X -configure`


----------



## SirDice (Jan 9, 2012)

If you have *HAL* and *dbus* running most of xorg.conf can be removed.

Here's mine:

```
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
EndSection

Section "Files"
        ModulePath   "/usr/local/lib/xorg/modules"
        FontPath     "/usr/local/lib/X11/fonts/misc/"
        FontPath     "/usr/local/lib/X11/fonts/TTF/"
        FontPath     "/usr/local/lib/X11/fonts/OTF"
        FontPath     "/usr/local/lib/X11/fonts/Type1/"
        FontPath     "/usr/local/lib/X11/fonts/100dpi/"
        FontPath     "/usr/local/lib/X11/fonts/75dpi/"
        FontPath     "/usr/local/lib/X11/fonts/bitstream-vera/"
        FontPath     "/usr/local/lib/X11/fonts/cyrillic/"
        FontPath     "/usr/local/lib/X11/fonts/webfonts/"
        FontPath     "/usr/local/lib/X11/fonts/dejavu/"
        FontPath     "/usr/local/lib/X11/fonts/terminus-font/"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Device"
        Identifier  "Card0"
        Driver      "nvidia"
        VendorName  "nVidia Corporation"
        BoardName   "G73 [GeForce 7600 GT]"
        BusID       "PCI:1:0:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection
```

I really only added a few fonts to it but everything else is as basic as it gets.


----------



## wblock@ (Jan 9, 2012)

SirDice said:
			
		

> If you have *HAL* and *dbus* running most of xorg.conf can be removed.



Even without hal, X will autodetect hardware when it starts.  devd(8) handles hot-connection of USB mice, too.


----------



## jotawski (Jan 20, 2012)

SirDice said:
			
		

> If you have *HAL* and *dbus* running most of xorg.conf can be removed.
> 
> I really only added a few fonts to it but everything else is as basic as it gets.



yes, I am going to ask how one can use installed fonts, for example texcm-ttf, without /etc/X11/xorg.conf.

At this moment, I am using startxfce4 without /etc/X11/xorg.conf.  My machine is 
	
	



```
[dell] ~> uname -a
FreeBSD dell.jes.or.th 9.0-RELEASE FreeBSD 9.0-RELEASE #2: Fri Jan 13 20:11:08 ICT 2012     
root@dell.jes.or.th:/kaitag/obj/usr/src/sys/JOTAWSKI  amd64
[dell] ~>
```


----------

