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