Linux On Libretto L5
[[ X-Window Setup ]]

2002.8/18


X-Window Setup



0.Summary
    Setup XFree86 server, fonts and so on.
    It was unexpectedly troublesome to make truetype fonts available properly with TurboLinux, although tasks were not that complicated after I figured out what should I do.
    I also corrected keyboard setup because an abnormal function was observed. It seemed it was a kind of troubles you see with Libretto L5 series only.
1.Initial setup of X Server
    Not like RedHat, the installer of TurboLinux did not setup X at an installation process, so you must do that with xf86cfg or xf86cofig after installation. 'XF86Setup' command is not included.
    Most of configurations are automated with xf86cfg. There are some options with the tool, but just run, save and exit will make it. For example, usually you have to edit XF86Config file to set display size to 1280x600, but even that correction was not required.
    By the way, X configuration file is /etc/X11/XF86Config-4 in Vine 2.5R where it is /etc/X11/XF86Config in TurboLinux. It's because the old version 3 is also available with Vine2.5R and /etc/X11/XF86Config is used for the version.
2.Changing color depth
    Default color depth by xf86cfg is 8bit, 256 colors. As Libretto L5 has 8MB video memory, 16 million colors is available. Add the following line to XF86Config file.
      DefaultDepth 24
3.Disable XKeyboard
    With XFree86, sometimes keys are entered twice with only one press when you type very quickly. For example, 'lls','lss' or 'llss' will be entered when you press 'l'and's'.
    Maybe I'm doing wrong action or something because I have no problem when type keys one by one. Yet I think it's a problem of X because the trouble does not happen on the console. This phenomenon was seen with Vine I installed on L5 previously, too.
    I have confirmed that there was no relation to the auto-repeat function of X.

    Since I had no trouble with the console, the problem was on Xkb.
    My solution was to disable Xkb. Add the following line to the Section "InputDevice" in the XF86Config file.
      Option "XkbDisable"
    Please be aware that some applications require Xkb function to run.
4.Changing system keyboard setup
    On Linux, I swap CapsLock key and Ctrl key. It can be done by using 'Option "XkbOptions" "ctrl:swapcaps"' but it will not work when you disable Xkb.
    Instead, I changed the system keyboard of console itself. With RedHat, you have a command 'kbdconfig' to do so, but manual setup is not that difficult either. What you have to do is just changing KEYTABLE entry in /etc/sysconfig/keyboard jp106 to jp106_Ctrl_CAPS as below:
      KEYTABLE="jp106_Ctrl_CAPS"
    You may swap CapsLock key and Ctrl key, both on console and X.
    The keytables you may select is in /usr/lib/kbd/keymaps/i386/qwerty/. The name of file is 'name_of_keymap + .kmap.gz'. For example, the file of 'jp106' is jp106.kmap.gz.
    If you need more arrangements on keymap, please use Xmodmap function.
5.Using USB mouse
    Most of USB mice are recognized at default setting.
    The configuration of xf86cfg is set, however, to use the built-in pointing device only so you may not use a USB mouse on X although it will be recognized.
    If you always use a USB mouse, just edit XF86Config file as follows:
                Section "InputDevice"
                	Option	    "Protocol" "PS/2"
                	Option	    "Device" "/dev/mouse"
                           |
                           V
                Section "InputDevice"
                	Option	    "Protocol" "IMPS/2"
                	Option	    "Device" "/dev/input/mice"
        
    But usually you want to use the built-in pointing device when you are out, and to use a connected USB mouse at home or at office. To enable hot plug and to make the USB mouse available, setup XF86Config and USB system file.
    (1) Setup XF86Config...step 1
      Add the following lines after the entry of PS/2 mouse so that you can use a USB mouse when it is up.
                  Section "InputDevice"
                  	Identifier  "Mouse9"
                  	Driver      "mouse"
                  	Option	    "Protocol" "IMPS/2"
                  	Option	    "Device" "/dev/input/mice"
                  	Option      "ZAxisMapping" "4 5"
                  	Option      "AlwaysCore"
                  EndSection
                
    (2) Setup XF86Config...step 2
      To let the X server recognize 'Mouse9' written above, add the following script in the 'ServerLayout' section.
                  Section "ServerLayout"
                  	Identifier     "XFree86 Configured"
                  	Screen      0  "Screen0" 0 0
                  	InputDevice    "Mouse0" "CorePointer"
                  	InputDevice    "Mouse9" "SendCoreEvents"
                  	InputDevice    "Keyboard0" "CoreKeyboard"
                  EndSection
                
    (3) Set USB's preload
      Please add the followings to /etc/muraski/murasaki.preload to let X server possible to access to USB mouse device even if a USB mouse is not connected yet when X server starts.
                      mousedev
                      hid
                      uhci
                      uhci
                
    You need no modification to make a wheel mouse function available.
6.Using TrueType fonts
    In comparison with other distributions like Vine2.5R, there were unexpected problems in using TrueType(scalable) fonts with X at the default environment. Shortly, modules and setup files were set to use those fonts, but they were not set available.
    In the recent sophisticated desktop environment of Linux, availability of TrueType fonts is quite important. So I made efforts to make those fonts usable although it was a sort of troublesome tasks.
    I can write what I've done only, but to contribute for troubleshooting I explain what I did step by step. If you want to know the core of the setting, read (5) below.

    (1) Setting up Font Server and start
      Set fonts path to configuration files of font server, that is 'dir' entry of /etc/X11/XtConfig or 'catalogue' entry of /etc/X11/fs/config.
      To start font server automatically, /etc/rc.d/init.d/xfs file exist with Vine. With TurboLinux, no 'rc file' to start the server is prepared. You must add the line below to /etc/rc.d/rc.local or something.
        /usr/X11R6/bin/xfs -daemon -droppriv
    (2) Access to font server
      X server is not set to access to font server as default in TurboLinux.
      You need to add the following line to "File" section in XF86Config to to access fonts resource the font server supplies.
        FontPath "unix/:7100"
      By this configuration, X applications like Gimp, Mozilla and OpenOffice can access fonts through the server.
    (3) Direct access to scalable font by X server
      Beside font access through the font server, version 4 X server and version 3 X server with Xtt patch can access TrueType fonts directly. In case of version 4 server, module to access tt-fonts must be specified.
      In Vine it is set so as default and you can let X server to access TrueType fonts by putting font paths to XF86Config-4 file.
      With TurblLinux, you have to add the following line in "Module" section of XF86Config to make the X server possible to access tt fonts directly.
        Load "xtt"
    (4) Select a way to access scalable fonts
      By the explanations above, you see you have options to access TrueType fonts, thorough the font server or by the module.
      Theoretically they are equivalent, and Libretto L5 is powerful enough to ignore the differences in performance. But in TurboLinux, you will have problem with the former method in Japanese environment; The X server fails to setup default Japanese font set.
      Consequentially default fonts of applications become single-byte fonts and characters on a menu will be broken.
      I haven't tried how it comes but it was OK as far as you use direct font access by X server.

    (5) Summary
      These are the setups finally done.
      • Access the fonts via module that will be loaded by X server. Do not use the font server.To do so, added the following line in "Module" section of XF86Config.
          Load "xtt"
      • Added script lines of paths of TrueType fonts' directory to XF86Config in Section "Files".
          Section "Files"
            FontPath "/usr/X11R6/lib/X11/fonts/ttf-zh"
            FontPath "/usr/X11R6/lib/X11/fonts/TrueType"
      • Make a directory to put TrueType fonts(ex./home/fonts), create fonts.dir file then add the path in the Section "Files" written abobe.
          FontPath "/home/fonts"





Index

Prev:Install <- -> Next:Setup PCMCIA adaptor, sound

Home

E-mail: neyubacca@yahoo.co.jp