1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 | ]>
|
---|
7 |
|
---|
8 | <sect1 id="xorg-config">
|
---|
9 | <?dbhtml filename="xorg-config.html"?>
|
---|
10 |
|
---|
11 | <sect1info>
|
---|
12 | <othername>$LastChangedBy$</othername>
|
---|
13 | <date>$Date$</date>
|
---|
14 | </sect1info>
|
---|
15 |
|
---|
16 | <title>Xorg-&xorg7-release; Testing and Configuration</title>
|
---|
17 |
|
---|
18 | <sect2 id='X11-testing' xreflabel="Testing Xorg">
|
---|
19 | <title>Testing Xorg</title>
|
---|
20 |
|
---|
21 | <para>To test the <application>Xorg</application> installation, issue
|
---|
22 | <userinput>startx</userinput>. This command brings up a rudimentary window
|
---|
23 | manager called <emphasis>twm</emphasis> with three xterm windows and one
|
---|
24 | xclock window. The xterm window in the upper left is a login terminal and
|
---|
25 | running <emphasis>exit</emphasis> from this terminal will exit the
|
---|
26 | <application>X Window</application> session. The third xterm window may be
|
---|
27 | obscured on your system by the other two xterms.</para>
|
---|
28 |
|
---|
29 | <para>Generally, there is no specific configuration required for
|
---|
30 | <application>Xorg</application>, but customization is possible. For details
|
---|
31 | see <xref linkend='xconfig'/> below.</para>
|
---|
32 |
|
---|
33 | </sect2>
|
---|
34 |
|
---|
35 | <sect2 role="configuration" id='checking-dri' xreflabel="Checking the DRI installation">
|
---|
36 | <title>Checking the Direct Rendering Infrastructure (DRI) Installation</title>
|
---|
37 |
|
---|
38 | <para>DRI is a framework for allowing software to access graphics hardware
|
---|
39 | in a safe and efficient manner. It is installed in <application>X</application>
|
---|
40 | by default (using <application>MesaLib</application>) if you have a supported
|
---|
41 | video card.</para>
|
---|
42 |
|
---|
43 | <para>To check if DRI is installed properly, check the log file
|
---|
44 | <filename>/var/log/Xorg.0.log</filename> for statements like:</para>
|
---|
45 |
|
---|
46 | <screen><literal>(II) R128(0): Direct rendering enabled</literal></screen>
|
---|
47 |
|
---|
48 | <note><para>DRI configuration may differ if you are using alternate
|
---|
49 | drivers, such as those from
|
---|
50 | <ulink url="http://www.nvidia.com/page/home.html">NVIDIA</ulink> or
|
---|
51 | <ulink url="http://www.ati.com/">ATI</ulink>.</para>
|
---|
52 | </note>
|
---|
53 |
|
---|
54 | <para>Although all users can use software acceleration, any hardware
|
---|
55 | acceleration (DRI2) is only available to
|
---|
56 | <systemitem class="username">root</systemitem> and members of the
|
---|
57 | <systemitem class="groupname">video</systemitem> group.</para>
|
---|
58 |
|
---|
59 | <para>To see if hardware acceleration is available for your driver, look in
|
---|
60 | <filename>/var/log/Xorg.0.log</filename> for statements like:</para>
|
---|
61 |
|
---|
62 | <screen><literal> (II) intel(0): direct rendering: DRI2 Enabled</literal></screen>
|
---|
63 |
|
---|
64 | <para>If your driver is supported, add any users that might use X to that group:</para>
|
---|
65 |
|
---|
66 | <screen role="root"><userinput>usermod -a -G video <replaceable><username></replaceable></userinput></screen>
|
---|
67 |
|
---|
68 | <para>If you elected to install the Mesa-Demos package when installing
|
---|
69 | <xref linkend="mesalib"/>, from an <command>xterm</command>, run
|
---|
70 | <command>glxinfo</command> and first look for the phrase:</para>
|
---|
71 |
|
---|
72 | <screen><computeroutput>direct rendering: Yes</computeroutput></screen>
|
---|
73 |
|
---|
74 | <para>If direct rendering is enabled, you can add verbosity by
|
---|
75 | running <command>LIBGL_DEBUG=verbose glxinfo</command>. This will
|
---|
76 | show the drivers, device nodes and files used by the DRI system.</para>
|
---|
77 |
|
---|
78 | <para>If DRI is enabled, to confirm that DRI2 hardware acceleration is
|
---|
79 | working you can (still in the <command>xterm</command>) run the command
|
---|
80 | <command>glxinfo | grep "OpenGL renderer string"</command> - if that
|
---|
81 | reports something <emphasis>other than</emphasis>
|
---|
82 | <literal>Software Rasterizer</literal> then you have working acceleration
|
---|
83 | for the user who ran the command.</para>
|
---|
84 |
|
---|
85 | <para>Again, if you have added the Mesa-Demos package, you can also
|
---|
86 | run the test program <command>glxgears</command>.
|
---|
87 | This program brings up a window with three gears turning. The
|
---|
88 | <command>xterm</command> will display how many frames were drawn every
|
---|
89 | five seconds, so this is a reasonable benchmark. The window is scalable,
|
---|
90 | and the frames drawn per second is highly dependent on the size of
|
---|
91 | the window.</para>
|
---|
92 |
|
---|
93 | </sect2>
|
---|
94 |
|
---|
95 | <sect2 role="configuration" id='X11R6-compat-symlink'
|
---|
96 | xreflabel="Creating an X11R6 Compatibility Symlink">
|
---|
97 |
|
---|
98 | <title>Creating an X11R6 Compatibility Symlink</title>
|
---|
99 |
|
---|
100 | <para>Until recently (relatively speaking) almost every
|
---|
101 | <application>X Window</application> installation you performed or came
|
---|
102 | across was installed in the
|
---|
103 | <filename class='directory'>/usr/X11R6</filename> directory. That was the
|
---|
104 | standard for years. Developers picked up on this and wrote their package
|
---|
105 | installation scripts looking for <application>X</application> in the
|
---|
106 | standard location. Things have changed and the trend is to now install
|
---|
107 | <application>X</application> in
|
---|
108 | <filename class='directory'>/usr</filename>. Some people want to install
|
---|
109 | it in a custom location.</para>
|
---|
110 |
|
---|
111 | <para>Many package developers have not caught up to the change and their
|
---|
112 | packages are still trying to find <application>X</application> in
|
---|
113 | <filename class='directory'>/usr/X11R6</filename> and subsequently fail
|
---|
114 | when you try to build the package. Though for most packages it is not
|
---|
115 | difficult to 'hack' the installation script to fix the problem, that is not
|
---|
116 | the long term solution to the problem. Upstream developers need to modernize
|
---|
117 | their installation scripts and eliminate the problem altogether.</para>
|
---|
118 |
|
---|
119 | <para>Until then, you can create a symbolic link to satisfy the
|
---|
120 | <filename class='directory'>/usr/X11R6</filename> requirement so that you
|
---|
121 | won't be inconvenienced with a package build failure due to this known
|
---|
122 | issue. If you wish to create the symlink, issue the following command as
|
---|
123 | the <systemitem class="username">root</systemitem>:</para>
|
---|
124 |
|
---|
125 | <screen role="root"><userinput>ln -vsf $XORG_PREFIX /usr/X11R6</userinput></screen>
|
---|
126 |
|
---|
127 | </sect2>
|
---|
128 |
|
---|
129 | <sect2 role="configuration" id="xft-font-protocol" xreflabel="Xft Font Protocol">
|
---|
130 | <title>Xft Font Protocol</title>
|
---|
131 |
|
---|
132 | <indexterm role="configuration" id=" fonts">
|
---|
133 | <primary sortas="g-truetype">TrueType Fonts</primary>
|
---|
134 | </indexterm>
|
---|
135 |
|
---|
136 | <para>Xft provides antialiased font rendering through
|
---|
137 | <application>Freetype</application>, and fonts are controlled from the
|
---|
138 | client side using <application>Fontconfig</application>. The default
|
---|
139 | search path is <filename class="directory">/usr/share/fonts</filename>
|
---|
140 | and <filename class="directory">~/.fonts</filename>.
|
---|
141 | <application>Fontconfig</application> searches directories in its
|
---|
142 | path recursively and maintains a cache of the font characteristics in
|
---|
143 | <filename>fonts.cache-1</filename> files in each directory. If the cache
|
---|
144 | appears to be out of date, it is ignored, and information is (slowly)
|
---|
145 | fetched from the fonts themselves. This cache
|
---|
146 | can be regenerated using the <command>fc-cache</command> command at any
|
---|
147 | time. You can see the list of fonts known by
|
---|
148 | <application>Fontconfig</application> by running the command
|
---|
149 | <command>fc-list</command>.</para>
|
---|
150 |
|
---|
151 | <para>If you've installed <application>Xorg</application> in any prefix
|
---|
152 | other than <filename class="directory">/usr</filename>, the
|
---|
153 | <application>X</application> fonts were not installed in a
|
---|
154 | location known to <application>Fontconfig</application>. This prevents
|
---|
155 | <application>Fontconfig</application> from using the poorly rendered
|
---|
156 | Type 1 fonts or the non-scalable bitmapped fonts. Symlinks were created
|
---|
157 | from the <filename class="directory">OTF</filename> and <filename
|
---|
158 | class="directory">TTF</filename> <application>X</application> font
|
---|
159 | directories to <filename
|
---|
160 | class="directory">/usr/share/fonts/X11-{OTF,TTF}</filename>. This allows
|
---|
161 | <application>Fontconfig</application> to use the OpenType and TrueType
|
---|
162 | fonts provided by <application>X</application> (which are scalable and
|
---|
163 | of higher quality).</para>
|
---|
164 |
|
---|
165 | <para><application>Fontconfig</application> uses names such as
|
---|
166 | "Monospace 12" to define fonts. Applications generally use generic font
|
---|
167 | names such as "Monospace", "Sans" and "Serif".
|
---|
168 | <application>Fontconfig</application> resolves these names to a font that
|
---|
169 | has all characters that cover the orthography of the language indicated
|
---|
170 | by the locale settings. Knowledge of these font names is included in
|
---|
171 | <filename>/etc/fonts/fonts.conf</filename>. Fonts that are not listed
|
---|
172 | in this file are still usable by <application>Fontconfig</application>,
|
---|
173 | but they will not be accessible by the generic family names.</para>
|
---|
174 |
|
---|
175 | <para>Standard scalable fonts that come with <application>X</application>
|
---|
176 | provide very poor Unicode coverage. You may notice in applications that
|
---|
177 | use <application>Xft</application> that some characters appear as a box
|
---|
178 | with four binary digits inside. In this case, a font set with the
|
---|
179 | available glyphs has not been found. Other times, applications that
|
---|
180 | don't use other font families by default and don't accept substitutions
|
---|
181 | from <application>Fontconfig</application> will display blank lines when
|
---|
182 | the default font doesn't cover the orthography of the user's language.
|
---|
183 | This happens, e.g., with <application>Fluxbox</application> in the
|
---|
184 | ru_RU.KOI8-R locale.</para>
|
---|
185 |
|
---|
186 | <para>In order to provide greater Unicode coverage, it is recommended
|
---|
187 | that you install these fonts:</para>
|
---|
188 |
|
---|
189 | <itemizedlist>
|
---|
190 | <listitem>
|
---|
191 | <para><ulink url="http://dejavu.sourceforge.net/">DejaVu fonts</ulink>
|
---|
192 | - These fonts are replacements for the Bitstream Vera fonts and
|
---|
193 | provide Latin-based scripts with accents and Cyrillic glyphs.</para>
|
---|
194 | </listitem>
|
---|
195 | <listitem>
|
---|
196 | <para><ulink
|
---|
197 | url="http://download.savannah.nongnu.org/releases/freefont/">FreeFont</ulink>
|
---|
198 | - This set of fonts covers nearly every non-CJK character, but is not
|
---|
199 | visually pleasing. <application>Fontconfig</application> will use it
|
---|
200 | as a last resort to substitute generic font family names.</para>
|
---|
201 | </listitem>
|
---|
202 | <listitem>
|
---|
203 | <para><ulink
|
---|
204 | url="http://corefonts.sourceforge.net/">Microsoft Core fonts</ulink>
|
---|
205 | - These fonts provide slightly worse Unicode coverage than FreeFont,
|
---|
206 | but are better hinted. Be sure to read the license before using
|
---|
207 | them. These fonts are listed in the aliases in the
|
---|
208 | <filename class="directory">/etc/fonts/fonts.d</filename> directory
|
---|
209 | by default.</para>
|
---|
210 | </listitem>
|
---|
211 | <listitem>
|
---|
212 | <para><ulink
|
---|
213 | url="http://cle.linux.org.tw/fonts/FireFly">Firefly New Sung font</ulink>
|
---|
214 | - This font provides Chinese coverage. This font is listed in the
|
---|
215 | aliases in the
|
---|
216 | the <filename class="directory">/etc/fonts/fonts.d</filename>
|
---|
217 | directory by default.</para>
|
---|
218 | </listitem>
|
---|
219 | <listitem>
|
---|
220 | <para><ulink
|
---|
221 | url="http://cle.linux.org.tw/fonts/Arphic">Arphic fonts</ulink> -
|
---|
222 | A similar set of Chinese fonts to the Firefly New Sung font.
|
---|
223 | These fonts are listed in the aliases in the
|
---|
224 | <filename class="directory">/etc/fonts/fonts.d</filename> directory
|
---|
225 | by default.</para>
|
---|
226 | </listitem>
|
---|
227 | <listitem>
|
---|
228 | <para><ulink
|
---|
229 | url="http://sourceforge.jp/projects/efont/">Kochi fonts</ulink> -
|
---|
230 | These provide Japanese characters, and are listed in the aliases
|
---|
231 | in the <filename class="directory">/etc/fonts/fonts.d</filename>
|
---|
232 | directory by default.</para>
|
---|
233 | </listitem>
|
---|
234 | <listitem>
|
---|
235 | <para><ulink
|
---|
236 | url="http://kldp.net/projects/baekmuk/">Baekmuk fonts</ulink>
|
---|
237 | - These fonts provide Korean coverage, and are listed in the
|
---|
238 | aliases in the
|
---|
239 | <filename class="directory">/etc/fonts/fonts.d</filename> directory
|
---|
240 | by default.</para>
|
---|
241 | </listitem>
|
---|
242 | <listitem>
|
---|
243 | <para><ulink
|
---|
244 | url="&gnome-download-http;/cantarell-fonts/0.0/">Cantarell fonts</ulink>
|
---|
245 | - The Cantarell typeface family provides a contemporary Humanist sans
|
---|
246 | serif. It is particularly optimised for legibility at small sizes and is
|
---|
247 | the preferred font family for the <application>GNOME-3</application> user
|
---|
248 | interface.</para>
|
---|
249 | </listitem>
|
---|
250 | </itemizedlist>
|
---|
251 |
|
---|
252 | <para>The list above will not provide complete Unicode coverage. For
|
---|
253 | more information, please visit the <ulink
|
---|
254 | url="http://unifont.org/fontguide/">Unicode Font Guide</ulink>.</para>
|
---|
255 |
|
---|
256 | <para>As an example, consider the installation of the DejaVu fonts. From
|
---|
257 | the unpacked source directory, run the following commands as the
|
---|
258 | <systemitem class="username">root</systemitem> user:</para>
|
---|
259 |
|
---|
260 | <screen role="root"><userinput>install -v -d -m755 /usr/share/fonts/dejavu &&
|
---|
261 | install -v -m644 *.ttf /usr/share/fonts/dejavu &&
|
---|
262 | fc-cache -v /usr/share/fonts/dejavu</userinput></screen>
|
---|
263 |
|
---|
264 | </sect2>
|
---|
265 |
|
---|
266 | <sect2 role="configuration" id='xconfig'>
|
---|
267 | <title>Setting up Xorg Devices</title>
|
---|
268 | <para>For most hardware configurations, modern Xorg will automatically
|
---|
269 | get the server configuration correct without any user intervention. There
|
---|
270 | are, however, some cases where auto-configuration will be incorrect.
|
---|
271 | Following are some example manual configuration items that may be of use in
|
---|
272 | these instances.</para>
|
---|
273 |
|
---|
274 | <sect3 id="xinput">
|
---|
275 | <title>Setting up X Input Devices</title>
|
---|
276 | <para>For most input devices, no additional configuration will be
|
---|
277 | necessary. This section is provided for informational purposes only.</para>
|
---|
278 |
|
---|
279 | <para>A sample default XKB setup could look like the following (executed as
|
---|
280 | the <systemitem class="username">root</systemitem> user):</para>
|
---|
281 | <screen><userinput role="username">cat > /etc/X11/xorg.conf.d/xkb-defaults.conf << "EOF"
|
---|
282 | Section "InputClass"
|
---|
283 | Identifier "XKB Defaults"
|
---|
284 | MatchIsKeyboard "yes"
|
---|
285 | Option "XkbOptions" "terminate:ctrl_alt_bksp"
|
---|
286 | EOF</userinput></screen>
|
---|
287 |
|
---|
288 | </sect3>
|
---|
289 |
|
---|
290 | <sect3 id="xdisplay">
|
---|
291 | <title>Fine Tuning Display Settings</title>
|
---|
292 | <para>Again, with modern Xorg, little or no additional configuration is
|
---|
293 | necessary. If you should need extra options passed to your video driver,
|
---|
294 | for instance, you could use something like the following (again, executed as
|
---|
295 | the <systemitem class="username">root</systemitem> user):</para>
|
---|
296 |
|
---|
297 | <screen><userinput role="root">cat > /etc/X11/xorg.conf.d/videocard-0.conf << "EOF"
|
---|
298 | Section "Device"
|
---|
299 | Identifier "Videocard0"
|
---|
300 | Driver "radeon"
|
---|
301 | VendorName "Videocard vendor"
|
---|
302 | BoardName "ATI Radeon 7500"
|
---|
303 | Option "NoAccel" "true"
|
---|
304 | EndSection
|
---|
305 | EOF</userinput></screen>
|
---|
306 |
|
---|
307 | <para>Another common setup is having multiple server layouts for use in
|
---|
308 | different environments. Though the server will automatically detect the
|
---|
309 | presence of another monitor, it may get the order incorrect:</para>
|
---|
310 |
|
---|
311 | <screen><userinput role="root">cat > /etc/X11/xorg.conf.d/server-layout.conf << "EOF"
|
---|
312 | Section "ServerLayout"
|
---|
313 | Identifier "DefaultLayout"
|
---|
314 | Screen 0 "Screen0" 0 0
|
---|
315 | Screen 1 "Screen1" LeftOf "Screen0"
|
---|
316 | Option "Xinerama"
|
---|
317 | EndSection
|
---|
318 | EOF</userinput></screen>
|
---|
319 |
|
---|
320 | </sect3>
|
---|
321 | </sect2>
|
---|
322 | </sect1>
|
---|