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