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 | <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>)
|
---|
18 | Installation</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
|
---|
25 | graphics hardware in a safe and efficient manner. It is installed in
|
---|
26 | <application>X</application> by default if you have a supported video card.
|
---|
27 | To 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
|
---|
34 | look 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>.
|
---|
39 | This program brings up a window with three gears turning. The
|
---|
40 | <command>xterm</command> will display how many frames were drawn every
|
---|
41 | five seconds, so this is a reasonable benchmark. The window is scalable, and
|
---|
42 | the frames drawn per second is highly dependent on the size of
|
---|
43 | the 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
|
---|
54 | 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 <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
|
---|
67 | be completed to make the fonts available. Each item is described in
|
---|
68 | detail 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.
|
---|
77 | Ensure that any fonts you install are world readable. Incorrect
|
---|
78 | permissions 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
|
---|
86 | directory.</para></listitem>
|
---|
87 |
|
---|
88 | <listitem><para>Ensure the <application>TrueType</application> module is
|
---|
89 | loaded 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
|
---|
108 | directory</title>
|
---|
109 |
|
---|
110 | <para>The build of <application>X</application> as given above automatically
|
---|
111 | creates a <application>TrueType</application> font directory:
|
---|
112 | <filename class="directory">/usr/X11R6/lib/X11/fonts/TTF</filename>. This
|
---|
113 | directory already has some <application>TrueType</application> fonts and is
|
---|
114 | set up correctly. If this directory is satisfactory, copy any other
|
---|
115 | <application>TrueType</application> fonts you want into that directory. If
|
---|
116 | not, create a new directory, preferably in the
|
---|
117 | <filename class="directory">/usr/X11R6/lib/X11/fonts/</filename> directory and
|
---|
118 | put 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
|
---|
126 | the <filename>.ttf</filename> suffix) to the directory you've just
|
---|
127 | created.</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 &&
|
---|
143 | mkfontdir</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 | ...
|
---|
159 | EndSection</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 | ...
|
---|
170 | EndSection</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
|
---|
177 | tags. Create <filename>/etc/fonts/local.conf</filename> using the
|
---|
178 | following 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 > /etc/fonts/local.conf << "EOF"</command>
|
---|
185 | <?xml version="1.0"?>
|
---|
186 | <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
---|
187 | <!-- /etc/fonts/local.conf file for local customizations -->
|
---|
188 |
|
---|
189 | <fontconfig>
|
---|
190 | <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>
|
---|
191 | <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>
|
---|
192 | </fontconfig>
|
---|
193 |
|
---|
194 | <command>EOF</command></userinput></screen>
|
---|
195 |
|
---|
196 | <!--
|
---|
197 | <screen><userinput><command>sed -i -e '/^<\/fontconfig>/i\
|
---|
198 | <dir>/usr/X11R6/lib/X11/fonts/TTF</dir>\
|
---|
199 | <dir>/usr/X11R6/lib/X11/fonts/Type1</dir>' /etc/fonts/local.conf</command></userinput></screen>
|
---|
200 | -->
|
---|
201 |
|
---|
202 | <para>The <command>fc-cache</command> program will automatically search
|
---|
203 | the 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.
|
---|
215 | You can check to see if the new fonts are available with the
|
---|
216 | <command>xlsfonts</command> or <command>xfontsel</command>
|
---|
217 | program.</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.
|
---|
222 | You should also rerun <command>fc-cache</command> each time
|
---|
223 | you 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
|
---|
232 | keyboard layouts do not include Latin configurations as was previous
|
---|
233 | practice. To set up a keyboard for Latin and non-Latin input,
|
---|
234 | change the XkbLayout keyboard driver option in the InputDevice section
|
---|
235 | of the <filename>XF86Config</filename> or <filename>xorg.conf</filename> file.
|
---|
236 | For 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
|
---|
247 | between keyboard layouts and use the Scroll Lock <acronym>LED</acronym> to
|
---|
248 | indicate 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
|
---|
256 | to make a few adjustments to their font settings in order to make sure that
|
---|
257 | fonts with the correct encoding are used for "fixed", "variable", "10x20" and
|
---|
258 | similar aliases:</para>
|
---|
259 |
|
---|
260 | <para>For Cyrillic alphabet, it is sufficient to put the following line
|
---|
261 | into the top of the "Files" section in <filename>XF86Config</filename>
|
---|
262 | or <filename>xorg.conf</filename> because this directory already contains
|
---|
263 | the 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
|
---|
268 | following 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
|
---|
279 | normally set up in <filename>/etc/inittab</filename>. Most of the information
|
---|
280 | you need to customize <command>xdm</command> is found in its man page. To
|
---|
281 | execute <command>xdm</command> during bootup, change the initdefault level to 5
|
---|
282 | and 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
|
---|
289 | x:5:respawn:/usr/X11R6/bin/xdm -nodaemon</userinput></screen></para>
|
---|
290 |
|
---|
291 | <para>If Linux-PAM is installed on your system, you should
|
---|
292 | create a PAM entry for xdm by duplicating the login entry
|
---|
293 | using 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
|
---|
307 | resources. Typically resources are set in the
|
---|
308 | <filename>~/.Xresources</filename> file.</para>
|
---|
309 |
|
---|
310 | <para>The layout of the <filename>~/.Xresources</filename> file consists
|
---|
311 | of 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
|
---|
320 | by either <emphasis>tight</emphasis>, represented by a dot (.),
|
---|
321 | or <emphasis>loose</emphasis>, represented by an asterisk (*), bindings.
|
---|
322 | A tight binding indicates that the components on either side of the dot must
|
---|
323 | be directly next to each other as defined in a specific implementation. An
|
---|
324 | asterisk is a wildcard character that means that any number of levels in
|
---|
325 | a defined hierarchy can be between the components.
|
---|
326 | For example, X offers two special cursors: redglass and whiteglass. To
|
---|
327 | use 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
|
---|
338 | respective client.</para>
|
---|
339 |
|
---|
340 | <para>In order to load your resources, the <command>xrdb</command> program
|
---|
341 | must be called with the appropriate parameters. Typically, the first time
|
---|
342 | resources are loaded, you use:</para>
|
---|
343 |
|
---|
344 | <screen><userinput><command>xrdb -load <filename></command></userinput></screen>
|
---|
345 |
|
---|
346 | <para>To add resources to <application>X</application>'s database in memory,
|
---|
347 | use:</para>
|
---|
348 |
|
---|
349 | <screen><userinput><command>xrdb -merge <filename></command></userinput></screen>
|
---|
350 |
|
---|
351 | <para>The <command>xrdb</command> instruction is usually placed in
|
---|
352 | <filename>~/.xinitrc</filename> or <filename>~/.xsession</filename>.
|
---|
353 | To 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 |
|
---|