source: x/installing/x-setup.xml@ 86af98a

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 86af98a was 86af98a, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Updated trunk sources to use DocBook DTD XML 4.4

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3629 af4574ff-66df-0310-9fd7-8a98e5e911e0

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