[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">
|
---|
[a0f03b0] | 9 | <sect1info>
|
---|
[5cd0959d] | 10 | <othername>$LastChangedBy$</othername>
|
---|
| 11 | <date>$Date$</date>
|
---|
[a0f03b0] | 12 | </sect1info>
|
---|
[feeb99a] | 13 | <?dbhtml filename="xfree86-setup.html"?>
|
---|
[646d9189] | 14 | <title>X Window System Components</title>
|
---|
[feeb99a] | 15 |
|
---|
[0bfe309a] | 16 | <sect2 id='dri'>
|
---|
[310960e4] | 17 | <title>Checking Direct Rendering Infrastructure (<acronym>DRI</acronym>)
|
---|
| 18 | Installation</title>
|
---|
[0bfe309a] | 19 |
|
---|
| 20 | <indexterm zone="x-setup dri">
|
---|
[310960e4] | 21 | <primary sortas="g-DRI">DRI</primary>
|
---|
[0bfe309a] | 22 | </indexterm>
|
---|
| 23 |
|
---|
[310960e4] | 24 | <para><acronym>DRI</acronym> is a framework for allowing software to access
|
---|
| 25 | graphics hardware in a safe and efficient manner. It is installed in
|
---|
| 26 | <application>X</application> by default if you have a supported video card.
|
---|
| 27 | To check if <acronym>DRI</acronym> is installed properly, check the log file
|
---|
| 28 | <filename>/var/log/XFree86.0.log</filename> or
|
---|
[feeb99a] | 29 | <filename>/var/log/Xorg.0.log</filename> for statements like:</para>
|
---|
| 30 |
|
---|
| 31 | <screen>(II) R128(0): Direct rendering enabled</screen>
|
---|
| 32 |
|
---|
[310960e4] | 33 | <para>From an <command>xterm</command>, run <command>glxinfo</command> and
|
---|
| 34 | look for the phrase:</para>
|
---|
| 35 |
|
---|
[feeb99a] | 36 | <screen>direct rendering: Yes</screen>
|
---|
| 37 |
|
---|
| 38 | <para>You can also run the test program <command>glxgears</command>.
|
---|
| 39 | This program brings up a window with three gears turning. The
|
---|
| 40 | <command>xterm</command> will display how many frames were drawn every
|
---|
| 41 | five seconds, so this is a reasonable benchmark. The window is scalable, and
|
---|
| 42 | the frames drawn per second is highly dependent on the size of
|
---|
| 43 | the window.</para>
|
---|
[0bfe309a] | 44 |
|
---|
| 45 | <indexterm zone="x-setup dri">
|
---|
| 46 | <primary sortas="b-glxgears">glxgears</primary>
|
---|
| 47 | </indexterm>
|
---|
| 48 |
|
---|
| 49 | <indexterm zone="x-setup dri">
|
---|
| 50 | <primary sortas="b-glxinfo">glxinfo</primary>
|
---|
| 51 | </indexterm>
|
---|
| 52 |
|
---|
[310960e4] | 53 | <para>For troubleshooting problems, check the <acronym>DRI</acronym> Users
|
---|
| 54 | Guide at
|
---|
| 55 | <ulink url="http://dri.sourceforge.net/doc/DRIuserguide.html"/>.</para>
|
---|
[0bfe309a] | 56 |
|
---|
[feeb99a] | 57 | </sect2>
|
---|
| 58 |
|
---|
| 59 | <!-- ================================================== -->
|
---|
| 60 |
|
---|
[0bfe309a] | 61 | <sect2 id='fonts'>
|
---|
[feeb99a] | 62 | <title>Adding <application>TrueType</application> fonts to
|
---|
| 63 | <application>X</application></title>
|
---|
| 64 |
|
---|
| 65 | <para><application>TrueType</application> font support is built into
|
---|
| 66 | <application>X</application>. The following items need to
|
---|
| 67 | be completed to make the fonts available.</para>
|
---|
| 68 |
|
---|
[0bfe309a] | 69 | <indexterm zone="x-setup fonts">
|
---|
| 70 | <primary sortas="g-truetype">TrueType</primary>
|
---|
| 71 | </indexterm>
|
---|
| 72 |
|
---|
[feeb99a] | 73 | <itemizedlist>
|
---|
| 74 | <listitem><para>Establish a directory for the fonts and move any
|
---|
[286510e1] | 75 | <application>TrueType</application> fonts you want into that directory.
|
---|
| 76 | Ensure that any fonts you install are world readable. Incorrect
|
---|
| 77 | permissions on fonts have been known to cause problems with some X
|
---|
| 78 | applications.</para></listitem>
|
---|
[feeb99a] | 79 |
|
---|
[c3af16e] | 80 | <listitem><para>Download the fonts.</para></listitem>
|
---|
| 81 |
|
---|
[feeb99a] | 82 | <listitem><para>Create the <filename>fonts.scale</filename> and
|
---|
[310960e4] | 83 | <filename>fonts.dir</filename> files in the
|
---|
[feeb99a] | 84 | <application>TrueType</application> font
|
---|
| 85 | directory.</para></listitem>
|
---|
| 86 |
|
---|
[310960e4] | 87 | <listitem><para>Ensure the <application>TrueType</application> module is
|
---|
| 88 | loaded in the <filename>XF86Config</filename> or
|
---|
| 89 | <filename>xorg.conf</filename>.</para></listitem>
|
---|
[feeb99a] | 90 |
|
---|
| 91 | <listitem><para>Ensure the <parameter>FontPath</parameter> in
|
---|
[646d9189] | 92 | <filename>XF86Config</filename> or <filename>xorg.conf</filename> contains the
|
---|
[feeb99a] | 93 | <application>TrueType</application> font directory.</para></listitem>
|
---|
| 94 |
|
---|
[310960e4] | 95 | <listitem><para>Update the font cache files</para></listitem>
|
---|
| 96 | </itemizedlist>
|
---|
| 97 |
|
---|
[0bfe309a] | 98 | <indexterm zone="x-setup fonts">
|
---|
[46b900a] | 99 | <primary sortas="e-etc-X11-xorg-conf">/etc/X11/xorg.conf</primary>
|
---|
[0bfe309a] | 100 | </indexterm>
|
---|
| 101 |
|
---|
| 102 | <indexterm zone="x-setup fonts">
|
---|
[3616dc5] | 103 | <primary sortas="e-etc-X11-XF86Config">/etc/X11/XF86Config</primary>
|
---|
[0bfe309a] | 104 | </indexterm>
|
---|
| 105 |
|
---|
[310960e4] | 106 | <sect3><title>Establish a <application>TrueType</application> font
|
---|
| 107 | directory</title>
|
---|
| 108 |
|
---|
| 109 | <para>The build of <application>X</application> as given above automatically
|
---|
| 110 | creates a <application>TrueType</application> font directory:
|
---|
| 111 | <filename class="directory">/usr/X11R6/lib/X11/fonts/TTF</filename>. This
|
---|
| 112 | directory already has some <application>TrueType</application> fonts and is
|
---|
| 113 | set up correctly. If this directory is satisfactory, copy any other
|
---|
| 114 | <application>TrueType</application> fonts you want into that directory. If
|
---|
| 115 | not, create a new directory, preferably in the
|
---|
| 116 | <filename class="directory">/usr/X11R6/lib/X11/fonts/</filename> directory and
|
---|
| 117 | put your <application>TrueType</application> fonts there.</para>
|
---|
| 118 | </sect3>
|
---|
[feeb99a] | 119 |
|
---|
[c3af16e] | 120 | <sect3><title>Download the fonts</title>
|
---|
| 121 |
|
---|
| 122 | <para>There are two known high quality free font resources:
|
---|
[310960e4] | 123 | <ulink url="ftp://ftp.gnu.org/savannah/files/freefont/"/> and
|
---|
| 124 | <ulink url="http://corefonts.sourceforge.net/"/>. Copy the fonts (files with
|
---|
[c3af16e] | 125 | the <filename>.ttf</filename> suffix) to the directory you've just
|
---|
| 126 | created.</para>
|
---|
| 127 |
|
---|
| 128 | </sect3>
|
---|
| 129 |
|
---|
[feeb99a] | 130 | <sect3><title>Create <filename>fonts.scale</filename> and
|
---|
| 131 | <filename>fonts.dir</filename></title>
|
---|
| 132 |
|
---|
| 133 | <para>Now change to the directory where you have your
|
---|
| 134 | <application>TrueType</application> fonts and run:
|
---|
| 135 | <screen><userinput><command>mkfontscale &&
|
---|
| 136 | mkfontdir</command></userinput></screen></para></sect3>
|
---|
| 137 |
|
---|
| 138 | <sect3><title>Ensure <application>TrueType</application> is loaded in
|
---|
| 139 | <filename>XF86Config</filename> or <filename>xorg.conf</filename></title>
|
---|
| 140 | <para>The "Module" section should look like:
|
---|
| 141 | <screen>Section "Module"
|
---|
| 142 | ...
|
---|
| 143 | Load "freetype"
|
---|
| 144 | ...
|
---|
[310960e4] | 145 | EndSection</screen></para>
|
---|
| 146 | </sect3>
|
---|
[feeb99a] | 147 |
|
---|
| 148 | <sect3><title>Ensure the <parameter>FontPath</parameter> in
|
---|
[646d9189] | 149 | <filename>XF86Config</filename> or <filename>xorg.conf</filename> points to the
|
---|
[feeb99a] | 150 | <application>TrueType</application> font directory</title>
|
---|
| 151 | <para>The "Files" section should look like:
|
---|
| 152 | <screen>Section "Files"
|
---|
| 153 | ...
|
---|
| 154 | FontPath "/usr/X11R6/lib/X11/fonts/<replaceable>[TrueTypeDir]</replaceable>/"
|
---|
| 155 | ...
|
---|
| 156 | EndSection</screen></para>
|
---|
| 157 | </sect3>
|
---|
| 158 |
|
---|
| 159 | <sect3><title>Update the font cache files</title>
|
---|
[646d9189] | 160 |
|
---|
| 161 | <para>Ensure you have the following directory entries in
|
---|
| 162 | <filename>/etc/fonts/local.conf</filename>, inside the fontconfig
|
---|
| 163 | tags:</para>
|
---|
| 164 |
|
---|
[0bfe309a] | 165 | <indexterm zone="x-setup fonts">
|
---|
| 166 | <primary sortas="e-etc-fonts-local.conf">/etc/fonts/local.conf</primary>
|
---|
| 167 | </indexterm>
|
---|
| 168 |
|
---|
[646d9189] | 169 | <screen><userinput><command>sed -i -e '/^<\/fontconfig>/i\
|
---|
| 170 | <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>\
|
---|
| 171 | <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>' /etc/fonts/local.conf</command></userinput></screen>
|
---|
| 172 |
|
---|
| 173 | <para>The <command>fc-cache</command> program will automatically search
|
---|
| 174 | the above directories and all subdirectories for needed fonts.</para>
|
---|
| 175 |
|
---|
[0bfe309a] | 176 | <para>Finally, to update all the font cache files, run</para>
|
---|
| 177 |
|
---|
[feeb99a] | 178 | <screen><userinput><command>fc-cache</command></userinput></screen>
|
---|
| 179 |
|
---|
[0bfe309a] | 180 | <indexterm zone="x-setup fonts">
|
---|
| 181 | <primary sortas="b-fc-cache">fc-cache</primary>
|
---|
| 182 | </indexterm>
|
---|
| 183 |
|
---|
[feeb99a] | 184 | <para><application>X</application> will now be able to use
|
---|
| 185 | <application>TrueType</application> fonts when it is restarted.
|
---|
| 186 | You can check to see if the new fonts are available with the
|
---|
| 187 | <command>xlsfonts</command> or <command>xfontsel</command>
|
---|
| 188 | program.</para>
|
---|
| 189 |
|
---|
| 190 | <note><para>You should rerun <command>mkfontscale</command> and
|
---|
| 191 | <command>mkfontdir</command> any time you add or delete
|
---|
| 192 | <application>TrueType</application> fonts.
|
---|
| 193 | You should also rerun <command>fc-cache</command> each time
|
---|
| 194 | you add or remove any fonts.</para></note>
|
---|
| 195 |
|
---|
| 196 | </sect3>
|
---|
| 197 | </sect2>
|
---|
| 198 |
|
---|
| 199 | <!-- ================================================== -->
|
---|
| 200 | <sect2>
|
---|
| 201 | <title>Setting up keyboards</title>
|
---|
[e3ef32f] | 202 | <para>In this version of <application>X</application>, non-Latin
|
---|
[feeb99a] | 203 | keyboard layouts do not include Latin configurations as was previous
|
---|
| 204 | practice. To set up a keyboard for Latin and non-Latin input,
|
---|
| 205 | change the XkbLayout keyboard driver option in the InputDevice section
|
---|
[310960e4] | 206 | of the <filename>XF86Config</filename> or <filename>xorg.conf</filename> file.
|
---|
| 207 | For example:</para>
|
---|
[feeb99a] | 208 |
|
---|
| 209 | <screen> Section "InputDevice"
|
---|
| 210 | Identifier "Keyboard0"
|
---|
| 211 | Driver "Keyboard"
|
---|
| 212 | Option "XkbModel" "pc105"
|
---|
| 213 | Option "XkbLayout" "en_US,ru"
|
---|
| 214 | Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
|
---|
| 215 | EndSection</screen>
|
---|
| 216 |
|
---|
| 217 | <para>In this example, you can use the Alt-Shift combination to switch
|
---|
[310960e4] | 218 | between keyboard layouts and use the Scroll Lock <acronym>LED</acronym> to
|
---|
| 219 | indicate when the second layout is active.</para>
|
---|
[feeb99a] | 220 | </sect2>
|
---|
| 221 |
|
---|
[c3af16e] | 222 | <!-- ================================================== -->
|
---|
| 223 | <sect2>
|
---|
| 224 | <title>Setting up fonts</title>
|
---|
[8337334] | 225 |
|
---|
[310960e4] | 226 | <para>Users using character sets other than <acronym>ISO</acronym>-8859-1 have
|
---|
| 227 | to make a few adjustments to their font settings in order to make sure that
|
---|
| 228 | fonts with the correct encoding are used for "fixed", "variable", "10x20" and
|
---|
[21aae54] | 229 | similar aliases:</para>
|
---|
| 230 |
|
---|
| 231 | <para>For Cyrillic alphabet, it is sufficient to put the following line
|
---|
[e3ef32f] | 232 | into the top of the "Files" section in <filename>XF86Config</filename>
|
---|
[310960e4] | 233 | or <filename>xorg.conf</filename> because this directory already contains
|
---|
| 234 | the needed bitmap fonts and their aliases:</para>
|
---|
[21aae54] | 235 |
|
---|
| 236 | <screen>FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/"</screen>
|
---|
[8337334] | 237 |
|
---|
[922d7eea] | 238 | <para>For ISO-8859-<replaceable>[X]</replaceable> based locales, use the
|
---|
| 239 | following command instead:</para>
|
---|
| 240 |
|
---|
| 241 | <screen><userinput><command>sed -i 's,iso8859-1\( \|$\),iso8859-<replaceable>[X]</replaceable>\1,g' \
|
---|
| 242 | /usr/X11R6/lib/X11/fonts/{75dpi,100dpi,misc}/fonts.alias</command></userinput></screen>
|
---|
| 243 |
|
---|
[c3af16e] | 244 | </sect2>
|
---|
| 245 |
|
---|
[feeb99a] | 246 | <!-- ================================================== -->
|
---|
[0bfe309a] | 247 | <sect2 id='xdm'>
|
---|
[feeb99a] | 248 | <title>Setting up XDM</title>
|
---|
| 249 | <para><command>xdm</command> provides a graphical logon capability and is
|
---|
| 250 | normally set up in <filename>/etc/inittab</filename>. Most of the information
|
---|
| 251 | you need to customize <command>xdm</command> is found in its man page. To
|
---|
| 252 | execute <command>xdm</command> during bootup, change the initdefault level to 5
|
---|
| 253 | and add the following lines to <filename>/etc/inittab</filename>:</para>
|
---|
| 254 |
|
---|
[0bfe309a] | 255 | <indexterm zone="x-setup xdm">
|
---|
| 256 | <primary sortas="b-xdm">xdm</primary>
|
---|
| 257 | </indexterm>
|
---|
| 258 |
|
---|
[feeb99a] | 259 | <para><screen><userinput># Run xdm as a separate service
|
---|
| 260 | x:5:respawn:/usr/X11R6/bin/xdm -nodaemon</userinput></screen></para>
|
---|
| 261 |
|
---|
| 262 | <para>If Linux-PAM is installed on your system, you should
|
---|
| 263 | create a PAM entry for xdm by duplicating the login entry
|
---|
| 264 | using the following command:</para>
|
---|
| 265 |
|
---|
| 266 | <para><screen><userinput>cp /etc/pam.d/login /etc/pam.d/xdm</userinput></screen></para>
|
---|
| 267 |
|
---|
| 268 | </sect2>
|
---|
| 269 |
|
---|
| 270 | <!-- ================================================== -->
|
---|
[0bfe309a] | 271 | <sect2 id='x-resources'>
|
---|
[feeb99a] | 272 | <title>Using <application>X</application> Resources</title>
|
---|
| 273 | <para>There are many options that can be set in
|
---|
| 274 | <application>X</application> and <application>X</application> clients via
|
---|
[310960e4] | 275 | resources. Typically resources are set in the
|
---|
| 276 | <filename>~/.Xresources</filename> file.</para>
|
---|
[feeb99a] | 277 |
|
---|
| 278 | <para>The layout of the <filename>~/.Xresources</filename> file consists
|
---|
| 279 | of a list of specifications in the form of</para>
|
---|
| 280 |
|
---|
[0bfe309a] | 281 | <indexterm zone="x-setup x-resources">
|
---|
[310960e4] | 282 | <primary sortas="e-AA.xresources">~/.Xresources</primary>
|
---|
[0bfe309a] | 283 | </indexterm>
|
---|
| 284 |
|
---|
[feeb99a] | 285 | <screen>object.subobject[.subobject...].attribute: value</screen>
|
---|
| 286 |
|
---|
| 287 | <para>Components of a resource specification are linked together
|
---|
| 288 | by either <emphasis>tight</emphasis>, represented by a dot (.),
|
---|
| 289 | or <emphasis>loose</emphasis>, represented by an asterisk (*), bindings.
|
---|
| 290 | A tight binding indicates that the components on either side of the dot must
|
---|
| 291 | be directly next to each other as defined in a specific implementation. An
|
---|
| 292 | asterisk is a wildcard character that means that any number of levels in
|
---|
| 293 | a defined hierarchy can be between the components.
|
---|
| 294 | For example, X offers two special cursors: redglass and whiteglass. To
|
---|
| 295 | use one of these resources, you need to add the following line:</para>
|
---|
| 296 |
|
---|
| 297 | <screen>Xcursor.theme: whiteglass</screen>
|
---|
| 298 |
|
---|
| 299 | <para>However, you can specify the background for all clients with:</para>
|
---|
| 300 |
|
---|
| 301 | <screen>*background: blue</screen>
|
---|
| 302 |
|
---|
[310960e4] | 303 | <para>More specific resource variables will override less specific names.</para>
|
---|
[feeb99a] | 304 |
|
---|
| 305 | <para>Resource definitions can be found in the man pages for each
|
---|
| 306 | respective client.</para>
|
---|
| 307 |
|
---|
[310960e4] | 308 | <para>In order to load your resources, the <command>xrdb</command> program
|
---|
| 309 | must be called with the appropriate parameters. Typically, the first time
|
---|
[feeb99a] | 310 | resources are loaded, you use:</para>
|
---|
| 311 |
|
---|
| 312 | <screen><userinput><command>xrdb -load <filename></command></userinput></screen>
|
---|
| 313 |
|
---|
[310960e4] | 314 | <para>To add resources to <application>X</application>'s database in memory,
|
---|
| 315 | use:</para>
|
---|
| 316 |
|
---|
[feeb99a] | 317 | <screen><userinput><command>xrdb -merge <filename></command></userinput></screen>
|
---|
| 318 |
|
---|
| 319 | <para>The <command>xrdb</command> instruction is usually placed in
|
---|
| 320 | <filename>~/.xinitrc</filename> or <filename>~/.xsession</filename>.
|
---|
| 321 | To get more information, see the xrdb man page.</para>
|
---|
| 322 |
|
---|
[0bfe309a] | 323 | <indexterm zone="x-setup x-resources">
|
---|
| 324 | <primary sortas="b-xrdb">xrdb</primary>
|
---|
| 325 | </indexterm>
|
---|
| 326 |
|
---|
| 327 | </sect2>
|
---|
[310960e4] | 328 |
|
---|
[feeb99a] | 329 | </sect1>
|
---|
| 330 |
|
---|