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