source: x/installing/x-setup.xml@ 7f2584b7

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 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 7f2584b7 was 7f2584b7, checked in by Randy McMurchy <randy@…>, 19 years ago

Updated to Leafnode-1.10.8; added more indexing tags to 'Configuring X Windows' instructions

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

  • Property mode set to 100644
File size: 12.9 KB
Line 
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<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:</para>
178
179<indexterm zone="x-setup fonts">
180 <primary sortas="e-etc-fonts-local.conf">/etc/fonts/local.conf</primary>
181</indexterm>
182
183<screen><userinput><command>sed -i -e '/^&lt;\/fontconfig&gt;/i\
184&lt;dir&gt;/usr/X11R6/lib/X11/fonts/TTF&lt;/dir&gt;\
185&lt;dir&gt;/usr/X11R6/lib/X11/fonts/Type1&lt;/dir&gt;' /etc/fonts/local.conf</command></userinput></screen>
186
187<para>The <command>fc-cache</command> program will automatically search
188the above directories and all subdirectories for needed fonts.</para>
189
190<para>Finally, to update all the font cache files, run</para>
191
192<screen><userinput><command>fc-cache</command></userinput></screen>
193
194<indexterm zone="x-setup fonts">
195 <primary sortas="b-fc-cache">fc-cache</primary>
196</indexterm>
197
198<para><application>X</application> will now be able to use
199<application>TrueType</application> fonts when it is restarted.
200You can check to see if the new fonts are available with the
201<command>xlsfonts</command> or <command>xfontsel</command>
202program.</para>
203
204<note><para>You should rerun <command>mkfontscale</command> and
205<command>mkfontdir</command> any time you add or delete
206<application>TrueType</application> fonts.
207You should also rerun <command>fc-cache</command> each time
208you add or remove any fonts.</para></note>
209
210</sect3>
211</sect2>
212
213<!-- ================================================== -->
214<sect2>
215<title>Setting up keyboards</title>
216<para>In this version of <application>X</application>, non-Latin
217keyboard layouts do not include Latin configurations as was previous
218practice. To set up a keyboard for Latin and non-Latin input,
219change the XkbLayout keyboard driver option in the InputDevice section
220of the <filename>XF86Config</filename> or <filename>xorg.conf</filename> file.
221For example:</para>
222
223<screen> Section "InputDevice"
224 Identifier "Keyboard0"
225 Driver "Keyboard"
226 Option "XkbModel" "pc105"
227 Option "XkbLayout" "en_US,ru"
228 Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
229 EndSection</screen>
230
231<para>In this example, you can use the Alt-Shift combination to switch
232between keyboard layouts and use the Scroll Lock <acronym>LED</acronym> to
233indicate when the second layout is active.</para>
234</sect2>
235
236<!-- ================================================== -->
237<sect2>
238<title>Setting up fonts</title>
239
240<para>Users using character sets other than <acronym>ISO</acronym>-8859-1 have
241to make a few adjustments to their font settings in order to make sure that
242fonts with the correct encoding are used for "fixed", "variable", "10x20" and
243similar aliases:</para>
244
245<para>For Cyrillic alphabet, it is sufficient to put the following line
246into the top of the "Files" section in <filename>XF86Config</filename>
247or <filename>xorg.conf</filename> because this directory already contains
248the needed bitmap fonts and their aliases:</para>
249
250<screen>FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/"</screen>
251
252<para>For ISO-8859-<replaceable>[X]</replaceable> based locales, use the
253following command instead:</para>
254
255<screen><userinput><command>sed -i 's,iso8859-1\( \|$\),iso8859-<replaceable>[X]</replaceable>\1,g' \
256 /usr/X11R6/lib/X11/fonts/{75dpi,100dpi,misc}/fonts.alias</command></userinput></screen>
257
258</sect2>
259
260<!-- ================================================== -->
261<sect2 id='xdm'>
262<title>Setting up XDM</title>
263<para><command>xdm</command> provides a graphical logon capability and is
264normally set up in <filename>/etc/inittab</filename>. Most of the information
265you need to customize <command>xdm</command> is found in its man page. To
266execute <command>xdm</command> during bootup, change the initdefault level to 5
267and add the following lines to <filename>/etc/inittab</filename>:</para>
268
269<indexterm zone="x-setup xdm">
270 <primary sortas="b-xdm">xdm</primary>
271</indexterm>
272
273<para><screen><userinput># Run xdm as a separate service
274x:5:respawn:/usr/X11R6/bin/xdm -nodaemon</userinput></screen></para>
275
276<para>If Linux-PAM is installed on your system, you should
277create a PAM entry for xdm by duplicating the login entry
278using the following command:</para>
279
280<para><screen><userinput>cp /etc/pam.d/login /etc/pam.d/xdm</userinput></screen></para>
281<indexterm zone="x-setup xdm">
282 <primary sortas="e-etc-pam.d/xdm">/etc/pam.d/xdm</primary>
283</indexterm>
284
285</sect2>
286
287<!-- ================================================== -->
288<sect2 id='x-resources'>
289<title>Using <application>X</application> Resources</title>
290<para>There are many options that can be set in
291<application>X</application> and <application>X</application> clients via
292resources. Typically resources are set in the
293<filename>~/.Xresources</filename> file.</para>
294
295<para>The layout of the <filename>~/.Xresources</filename> file consists
296of a list of specifications in the form of</para>
297
298<indexterm zone="x-setup x-resources">
299 <primary sortas="e-AA.xresources">~/.Xresources</primary>
300</indexterm>
301
302<screen>object.subobject[.subobject...].attribute: value</screen>
303
304<para>Components of a resource specification are linked together
305by either <emphasis>tight</emphasis>, represented by a dot (.),
306or <emphasis>loose</emphasis>, represented by an asterisk (*), bindings.
307A tight binding indicates that the components on either side of the dot must
308be directly next to each other as defined in a specific implementation. An
309asterisk is a wildcard character that means that any number of levels in
310a defined hierarchy can be between the components.
311For example, X offers two special cursors: redglass and whiteglass. To
312use one of these resources, you need to add the following line:</para>
313
314<screen>Xcursor.theme: whiteglass</screen>
315
316<para>However, you can specify the background for all clients with:</para>
317
318<screen>*background: blue</screen>
319
320<para>More specific resource variables will override less specific names.</para>
321
322<para>Resource definitions can be found in the man pages for each
323respective client.</para>
324
325<para>In order to load your resources, the <command>xrdb</command> program
326must be called with the appropriate parameters. Typically, the first time
327resources are loaded, you use:</para>
328
329<screen><userinput><command>xrdb -load &lt;filename&gt;</command></userinput></screen>
330
331<para>To add resources to <application>X</application>'s database in memory,
332use:</para>
333
334<screen><userinput><command>xrdb -merge &lt;filename&gt;</command></userinput></screen>
335
336<para>The <command>xrdb</command> instruction is usually placed in
337<filename>~/.xinitrc</filename> or <filename>~/.xsession</filename>.
338To get more information, see the xrdb man page.</para>
339
340<indexterm zone="x-setup x-resources">
341 <primary sortas="b-xrdb">xrdb</primary>
342</indexterm>
343
344</sect2>
345
346</sect1>
347
Note: See TracBrowser for help on using the repository browser.