[feeb99a] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="x-setup">
|
---|
| 9 | <?dbhtml filename="xfree86-setup.html"?>
|
---|
[646d9189] | 10 | <title>X Window System Components</title>
|
---|
[feeb99a] | 11 |
|
---|
| 12 | <sect2>
|
---|
| 13 | <title>Checking Direct Rendering Infrastructure (<acronym>DRI</acronym>) Installation</title>
|
---|
| 14 | <para><acronym>DRI</acronym> is a framework for allowing software to access graphics hardware
|
---|
| 15 | in a safe and efficient manner. It is installed in
|
---|
| 16 | <application>X</application> by default if
|
---|
| 17 | you have a supported video card. To check if <acronym>DRI</acronym> is installed properly,
|
---|
| 18 | check the log file <filename>/var/log/XFree86.0.log</filename> or
|
---|
| 19 | <filename>/var/log/Xorg.0.log</filename> for statements like:</para>
|
---|
| 20 |
|
---|
| 21 | <screen>(II) R128(0): Direct rendering enabled</screen>
|
---|
| 22 |
|
---|
| 23 | <para>From an <command>xterm</command>, run <command>glxinfo</command> and look for the phrase:</para>
|
---|
| 24 | <screen>direct rendering: Yes</screen>
|
---|
| 25 |
|
---|
| 26 | <para>You can also run the test program <command>glxgears</command>.
|
---|
| 27 | This program brings up a window with three gears turning. The
|
---|
| 28 | <command>xterm</command> will display how many frames were drawn every
|
---|
| 29 | five seconds, so this is a reasonable benchmark. The window is scalable, and
|
---|
| 30 | the frames drawn per second is highly dependent on the size of
|
---|
| 31 | the window.</para>
|
---|
| 32 |
|
---|
| 33 | <para>For troubleshooting problems, check the <acronym>DRI</acronym> Users Guide at
|
---|
| 34 | <ulink url="http://dri.sourceforge.net/doc/DRIuserguide.html"/>.
|
---|
| 35 | </para>
|
---|
| 36 | </sect2>
|
---|
| 37 |
|
---|
| 38 | <!-- ================================================== -->
|
---|
| 39 |
|
---|
| 40 | <sect2>
|
---|
| 41 | <title>Adding <application>TrueType</application> fonts to
|
---|
| 42 | <application>X</application></title>
|
---|
| 43 |
|
---|
| 44 | <para><application>TrueType</application> font support is built into
|
---|
| 45 | <application>X</application>. The following items need to
|
---|
| 46 | be completed to make the fonts available.</para>
|
---|
| 47 |
|
---|
| 48 | <itemizedlist>
|
---|
| 49 |
|
---|
| 50 | <listitem><para>Establish a directory for the fonts and move any
|
---|
| 51 | <application>TrueType</application> fonts you want into that directory.</para></listitem>
|
---|
| 52 |
|
---|
| 53 | <listitem><para>Create the <filename>fonts.scale</filename> and
|
---|
| 54 | <filename>fonts.dir</filename> files in the
|
---|
| 55 | <application>TrueType</application> font
|
---|
| 56 | directory.</para></listitem>
|
---|
| 57 |
|
---|
| 58 | <listitem><para>Ensure the <application>TrueType</application> module is loaded in the
|
---|
| 59 | <filename>XF86Config</filename> or <filename>xorg.conf</filename>.</para></listitem>
|
---|
| 60 |
|
---|
| 61 | <listitem><para>Ensure the <parameter>FontPath</parameter> in
|
---|
[646d9189] | 62 | <filename>XF86Config</filename> or <filename>xorg.conf</filename> contains the
|
---|
[feeb99a] | 63 | <application>TrueType</application> font directory.</para></listitem>
|
---|
| 64 |
|
---|
[646d9189] | 65 | <listitem><para>Update the font cache files</para></listitem>
|
---|
| 66 |
|
---|
[feeb99a] | 67 | </itemizedlist>
|
---|
| 68 |
|
---|
| 69 | <sect3><title>Establish a <application>TrueType</application> font directory</title>
|
---|
| 70 |
|
---|
| 71 | <para>The build of <application>X</application> as given above
|
---|
| 72 | automatically creates a <application>TrueType</application>
|
---|
| 73 | font directory: <filename class="directory">/usr/X11R6/lib/X11/fonts/TTF</filename>. This
|
---|
| 74 | directory already has some <application>TrueType</application> fonts and is set up correctly.
|
---|
| 75 | If this directory is satisfactory, copy any other
|
---|
| 76 | <application>TrueType</application> fonts you want
|
---|
| 77 | into that directory. If not, create a new directory, preferably in
|
---|
| 78 | the <filename class="directory">/usr/X11R6/lib/X11/fonts/</filename> directory and put
|
---|
| 79 | your <application>TrueType</application> fonts there.</para></sect3>
|
---|
| 80 |
|
---|
| 81 | <sect3><title>Create <filename>fonts.scale</filename> and
|
---|
| 82 | <filename>fonts.dir</filename></title>
|
---|
| 83 |
|
---|
| 84 | <para>Now change to the directory where you have your
|
---|
| 85 | <application>TrueType</application> fonts and run:
|
---|
| 86 | <screen><userinput><command>mkfontscale &&
|
---|
| 87 | mkfontdir</command></userinput></screen></para></sect3>
|
---|
| 88 |
|
---|
| 89 | <sect3><title>Ensure <application>TrueType</application> is loaded in
|
---|
| 90 | <filename>XF86Config</filename> or <filename>xorg.conf</filename></title>
|
---|
| 91 | <para>The "Module" section should look like:
|
---|
| 92 | <screen>Section "Module"
|
---|
| 93 | ...
|
---|
| 94 | Load "freetype"
|
---|
| 95 | ...
|
---|
| 96 | EndSection</screen></para></sect3>
|
---|
| 97 |
|
---|
| 98 | <sect3><title>Ensure the <parameter>FontPath</parameter> in
|
---|
[646d9189] | 99 | <filename>XF86Config</filename> or <filename>xorg.conf</filename> points to the
|
---|
[feeb99a] | 100 | <application>TrueType</application> font directory</title>
|
---|
| 101 | <para>The "Files" section should look like:
|
---|
| 102 | <screen>Section "Files"
|
---|
| 103 | ...
|
---|
| 104 | FontPath "/usr/X11R6/lib/X11/fonts/<replaceable>[TrueTypeDir]</replaceable>/"
|
---|
| 105 | ...
|
---|
| 106 | EndSection</screen></para>
|
---|
| 107 | </sect3>
|
---|
| 108 |
|
---|
| 109 | <sect3><title>Update the font cache files</title>
|
---|
[646d9189] | 110 |
|
---|
| 111 | <para>Ensure you have the following directory entries in
|
---|
| 112 | <filename>/etc/fonts/local.conf</filename>, inside the fontconfig
|
---|
| 113 | tags:</para>
|
---|
| 114 |
|
---|
| 115 | <screen><userinput><command>sed -i -e '/^<\/fontconfig>/i\
|
---|
| 116 | <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>\
|
---|
| 117 | <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>' /etc/fonts/local.conf</command></userinput></screen>
|
---|
| 118 |
|
---|
| 119 | <para>The <command>fc-cache</command> program will automatically search
|
---|
| 120 | the above directories and all subdirectories for needed fonts.</para>
|
---|
| 121 |
|
---|
[feeb99a] | 122 | <para>Finally, to update all the font
|
---|
[646d9189] | 123 | cache files, run</para>
|
---|
[feeb99a] | 124 | <screen><userinput><command>fc-cache</command></userinput></screen>
|
---|
| 125 |
|
---|
| 126 | <para><application>X</application> will now be able to use
|
---|
| 127 | <application>TrueType</application> fonts when it is restarted.
|
---|
| 128 | You can check to see if the new fonts are available with the
|
---|
| 129 | <command>xlsfonts</command> or <command>xfontsel</command>
|
---|
| 130 | program.</para>
|
---|
| 131 |
|
---|
| 132 | <note><para>You should rerun <command>mkfontscale</command> and
|
---|
| 133 | <command>mkfontdir</command> any time you add or delete
|
---|
| 134 | <application>TrueType</application> fonts.
|
---|
| 135 | You should also rerun <command>fc-cache</command> each time
|
---|
| 136 | you add or remove any fonts.</para></note>
|
---|
| 137 |
|
---|
| 138 | </sect3>
|
---|
| 139 | </sect2>
|
---|
| 140 |
|
---|
| 141 | <!-- ================================================== -->
|
---|
| 142 | <sect2>
|
---|
| 143 | <title>Setting up keyboards</title>
|
---|
| 144 | <para>In this version of <application>X</application>, it has been reported that non-Latin
|
---|
| 145 | keyboard layouts do not include Latin configurations as was previous
|
---|
| 146 | practice. To set up a keyboard for Latin and non-Latin input,
|
---|
| 147 | change the XkbLayout keyboard driver option in the InputDevice section
|
---|
| 148 | of the <filename>XF86Config</filename> or <filename>xorg.conf</filename> file. For example:</para>
|
---|
| 149 |
|
---|
| 150 | <screen> Section "InputDevice"
|
---|
| 151 | Identifier "Keyboard0"
|
---|
| 152 | Driver "Keyboard"
|
---|
| 153 | Option "XkbModel" "pc105"
|
---|
| 154 | Option "XkbLayout" "en_US,ru"
|
---|
| 155 | Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
|
---|
| 156 | EndSection</screen>
|
---|
| 157 |
|
---|
| 158 | <para>In this example, you can use the Alt-Shift combination to switch
|
---|
| 159 | between keyboard layouts and use the Scroll Lock <acronym>LED</acronym> to indicate when
|
---|
| 160 | the second layout is active.</para>
|
---|
| 161 | </sect2>
|
---|
| 162 |
|
---|
| 163 | <!-- ================================================== -->
|
---|
| 164 | <sect2>
|
---|
| 165 | <title>Setting up XDM</title>
|
---|
| 166 | <para><command>xdm</command> provides a graphical logon capability and is
|
---|
| 167 | normally set up in <filename>/etc/inittab</filename>. Most of the information
|
---|
| 168 | you need to customize <command>xdm</command> is found in its man page. To
|
---|
| 169 | execute <command>xdm</command> during bootup, change the initdefault level to 5
|
---|
| 170 | and add the following lines to <filename>/etc/inittab</filename>:</para>
|
---|
| 171 |
|
---|
| 172 | <para><screen><userinput># Run xdm as a separate service
|
---|
| 173 | x:5:respawn:/usr/X11R6/bin/xdm -nodaemon</userinput></screen></para>
|
---|
| 174 |
|
---|
| 175 | <para>If Linux-PAM is installed on your system, you should
|
---|
| 176 | create a PAM entry for xdm by duplicating the login entry
|
---|
| 177 | using the following command:</para>
|
---|
| 178 |
|
---|
| 179 | <para><screen><userinput>cp /etc/pam.d/login /etc/pam.d/xdm</userinput></screen></para>
|
---|
| 180 |
|
---|
| 181 | </sect2>
|
---|
| 182 |
|
---|
| 183 | <!-- ================================================== -->
|
---|
| 184 | <sect2>
|
---|
| 185 | <title>Using <application>X</application> Resources</title>
|
---|
| 186 | <para>There are many options that can be set in
|
---|
| 187 | <application>X</application> and <application>X</application> clients via
|
---|
| 188 | resources. Typically resources are set in the <filename>~/.Xresources</filename>
|
---|
| 189 | file.</para>
|
---|
| 190 |
|
---|
| 191 | <para>The layout of the <filename>~/.Xresources</filename> file consists
|
---|
| 192 | of a list of specifications in the form of</para>
|
---|
| 193 |
|
---|
| 194 | <screen>object.subobject[.subobject...].attribute: value</screen>
|
---|
| 195 |
|
---|
| 196 | <para>Components of a resource specification are linked together
|
---|
| 197 | by either <emphasis>tight</emphasis>, represented by a dot (.),
|
---|
| 198 | or <emphasis>loose</emphasis>, represented by an asterisk (*), bindings.
|
---|
| 199 | A tight binding indicates that the components on either side of the dot must
|
---|
| 200 | be directly next to each other as defined in a specific implementation. An
|
---|
| 201 | asterisk is a wildcard character that means that any number of levels in
|
---|
| 202 | a defined hierarchy can be between the components.
|
---|
| 203 | For example, X offers two special cursors: redglass and whiteglass. To
|
---|
| 204 | use one of these resources, you need to add the following line:</para>
|
---|
| 205 |
|
---|
| 206 | <screen>Xcursor.theme: whiteglass</screen>
|
---|
| 207 |
|
---|
| 208 | <para>However, you can specify the background for all clients with:</para>
|
---|
| 209 |
|
---|
| 210 | <screen>*background: blue</screen>
|
---|
| 211 |
|
---|
| 212 | <para>More specific resource variables will override less specific names. </para>
|
---|
| 213 |
|
---|
| 214 | <para>Resource definitions can be found in the man pages for each
|
---|
| 215 | respective client.</para>
|
---|
| 216 |
|
---|
| 217 | <para>In order to load your resources, the <command>xrdb</command>
|
---|
| 218 | program must be
|
---|
| 219 | called with the appropriate parameters. Typically, the first time
|
---|
| 220 | resources are loaded, you use:</para>
|
---|
| 221 |
|
---|
| 222 | <screen><userinput><command>xrdb -load <filename></command></userinput></screen>
|
---|
| 223 |
|
---|
| 224 | <para>To add resources to <application>X</application>'s database in memory, use:</para>
|
---|
| 225 | <screen><userinput><command>xrdb -merge <filename></command></userinput></screen>
|
---|
| 226 |
|
---|
| 227 | <para>The <command>xrdb</command> instruction is usually placed in
|
---|
| 228 | <filename>~/.xinitrc</filename> or <filename>~/.xsession</filename>.
|
---|
| 229 | To get more information, see the xrdb man page.</para>
|
---|
| 230 | </sect2>
|
---|
| 231 |
|
---|
| 232 | </sect1>
|
---|
| 233 |
|
---|