-->

Previous | Table of Contents | Next

Page 183


Section "Screen"

    Driver     "vga16"

    Device     "Generic VGA"

    Monitor    "Generic Monitor"

    Subsection "Display"

        Modes      "640x480"

        ViewPort    0 0

        Virtual     800 600

    EndSubsection

EndSection



# The Mono server



Section "Screen"

    Driver     "vga2"

    Device     "Generic VGA"

    Monitor    "Generic Monitor"

    Subsection "Display"

        Modes      "640x480"

        ViewPort    0 0

        Virtual     800 600

    EndSubsection

EndSection

The Mode line in a video section can have up to 10 values. Be very careful when modifying these values because a wrong setting may wind up destroying your monitor! It does not matter if these are not present because defaults can be used. A typical line to override defaults for a monitor would be:


"640x400" 28 640 480 728 776 480 480 482 494

The 10 values in order from left to right are shown in the following section. These values only make sense to video engineers or those folks who have to work with a monitor not defined in the default modes. Check your monitor's hardware specifications and get the values from there to fill in these ten parameters. The following are the fields to set:

Page 184

Multiscan monitors handle frequencies of 15 to 40 mHz. Some monitors work at 72 mHz vertical scan to prevent the flicker. You have to be able to calculate the frequency from the monitor's specification and come up with these numbers. A good place to start would be the XFree86-HOWTO document on how to get these values. Keep in mind that your video monitor is just a glorified television. You give it wrong values and you can fry it.

International Keyboard Layout for XFree86

XFree86 servers are able to read the key table from the Linux kernel, so you need to set up only one keyboard layout file (for the kernel). There are some restrictions, though; the kernel can support more keyboard functions than X11. X11 can only modify one of the four key tables. This modifier is called ModeShift.

Configurable keys for the ModeShift modifier are LeftAlt, RightAlt (=AltGr), RightCtl, and ScrollLock.

Usually the AltGr key is used for international keyboard modifications. To enable the XFree86 server to read the AltGr key table from the kernel, you should put the following line in the .olvwmrc file:


RightAlt "ModeShift"

Besides supporting only one additional key map, X11 cannot use dead keys. A key is called dead if when it is typed, it does not print a character until a second character is typed. A typical example is an accent key. Such keys are not supported by X11, so you need to replace all dead-key symbols with non-dead equivalents. Table 10.1 lists what you have to change.

Table 10.1. Key symbols.


Non-Dead dead_tilde
Dead
ASCII tilde
dead_grave grave
dead_circumflex ASCII circum
dead_acute apostrophe
dead_diaeresis diaeresis

Instead of supporting dead keys, XFree86 supports a Compose key. This feature is described in the XFree86kbd man page and can be modified by assigning the Compose function to one of the keys. By default the ScrollLock key has the Compose function.

If you still want to have the dead keys on the console, you will have to use an xmodmap file to map the keys to the correct symbols under X. This is also the method that must be used with earlier versions of XFree86. On sunsite in the directory /pub/Linux/X11/misc, you can find sample xmodmap files for several languages. Note that you have to set the ModeShift modifier to get the right key table working.

Page 185

Please read the kbd.FAQ that comes with the kbd package for Linux. You will find many hints for modifying your keyboard layout on the console, as well as for X.

The .xinitrc File

To use X, you need a startup file that calls the local modifications, the window manager, and an application you want to use right after X has started. If you are using startx (or runx) to start X, this startup file is called xinitrc. There is a standard xinitrc file, /usr/lib/X11/xinit/xinitrc, which is the traditional location for this file. The Linux filesystem standard places this file in /etc/X11/xinit/xinitrc in order to allow a read-only mounted /usr partition, so look in that location first.

If you are not content with what this file does (for instance, if you want to use a different window manager), you should copy it to the file .xinitrc in your home directory. After copying the file, you can edit it. Look at the man pages for startx and xinit for more information.

Note that both the .xinitrc and the .Xresources files must be readable and executable, so run the following commands on these files after editing them. You only have to run the chmod command once on the application.


$ chmod u+rx .xinitrc .Xresources

This command makes these files executable.

See Listing 10.6 for a sample .xinitrc file.

Listing 10.6. A sample .xinitrc file.


    1 #!/bin/sh

    2 # $XConsortium: xinitrc.cpp,v 1.4 91/08/22 11:41:34 rws Exp $

    3 # modified by obz

    4 userresources=$HOME/.Xresources

    5 usermodmap=$HOME/.Xmodmap

    6 sysresources=/usr/lib/X11/xinit/.Xresources

    7 sysmodmap=/usr/lib/X11/xinit/.Xmodmap

    8 # merge in defaults and keymaps

    9 if [ -f $sysresources ]; then

   10     xrdb -merge $sysresources

   11 fi

   12 if [ -f $sysmodmap ]; then

   13     xmodmap $sysmodmap

   14 fi

   15 if [ -f $userresources ]; then

   16     xrdb -merge $userresources

   17 fi


                                                                 continues

Previous | Table of Contents | Next