source: x/installing/x-setup.xml@ 0bfe309a

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 0bfe309a was 0bfe309a, checked in by Bruce Dubbs <bdubbs@…>, 19 years ago

Tagging updates

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

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