source: x/installing/x-setup.xml@ e257101

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.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 e257101 was e257101, checked in by DJ Lucas <dj@…>, 18 years ago

xorg and xorg7 cleanup

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

  • Property mode set to 100644
File size: 25.8 KB
Line 
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" xreflabel="X Window System Components">
9 <?dbhtml filename="x-setup.html"?>
10
11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
15
16 <title>X Window System Components</title>
17
18 <sect2 role="configuration" id='xconfig'>
19 <title>Configuring The X Window System</title>
20
21 <para>If you've installed the X Window System in any prefix other
22 than <filename>/usr</filename>, as the
23 <systemitem class="username">root</systemitem> user, add
24 <filename class="directory">
25 <replaceable>&lt;/usr/X11R6&gt;</replaceable>/lib</filename> to
26 the <filename>/etc/ld.so.conf</filename> file and run
27 <command>ldconfig</command>. Additionally, while still the
28 <systemitem class="username">root</systemitem> user, ensure
29 <filename class="directory">
30 <replaceable>&lt;/usr/X11R6&gt;</replaceable>/bin</filename>
31 and <filename class="directory">
32 <replaceable>&lt;/usr/X11R6&gt;</replaceable>/lib/pkgconfig</filename>
33 are added to your <envar>PATH</envar> and <envar>PKG_CONFIG_PATH</envar>
34 environment variables, respectively. Instructions for doing this are
35 described in the section <xref linkend='postlfs-config-profile'/>.</para>
36
37 <para>As the <systemitem class="username">root</systemitem> user
38 create a basic X Window System configuration file with the following
39 commands:</para>
40
41 <para>For <application>Xorg</application>:</para>
42<screen><userinput>cd ~ &amp;&amp;
43Xorg -configure</userinput></screen>
44
45 <para>For <application>XFree86</application>:</para>
46<screen><userinput>cd ~ &amp;&amp;
47XFree86 -configure</userinput></screen>
48
49 <indexterm zone="x-setup xconfig">
50 <primary sortas="e-etc-X11-xorg-conf">/etc/X11/xorg.conf</primary>
51 </indexterm>
52
53 <indexterm zone="x-setup xconfig">
54 <primary sortas="e-etc-X11-XF86Config">/etc/X11/XF86Config</primary>
55 </indexterm>
56
57 <para>The screen will go black and you may hear some clicking of the
58 monitor. This command will create a file in your
59 home directory, <filename>xorg.conf.new</filename> for
60 <application>Xorg</application>, or <filename>XF86Config.new</filename>
61 for <application>XFree86</application>.</para>
62
63 <para>Edit the newly created configuration file to suit your system. The
64 details of the files are located in the <filename>xorg.conf.5x</filename>
65 and <filename>XF86Config.5x</filename> man
66 pages. Some things you may want to do are:</para>
67
68 <itemizedlist>
69 <listitem>
70 <para>Section "Files". Change the order of the font paths searched.
71 You may want to put 100dpi fonts ahead of 75dpi fonts if your system
72 normally comes up closer to 100 dots per inch. You may want to remove
73 some font directories completely.</para>
74 </listitem>
75 <listitem>
76 <para>Section "Module". If you are going to install NVidia
77 drivers, remove the "dri" line.</para>
78 </listitem>
79 <listitem>
80 <para>Sections "InputDevice". You may want to change the
81 keyboard autorepeat rate by adding
82 <option>Option "Autorepeat" "250 30"</option>.</para>
83 </listitem>
84 <listitem>
85 <para>Section "Monitor". Specify the <option>VertRefresh</option>
86 and <option>HorizSync</option> values if the system does not
87 automatically detect the monitor and its values.</para>
88 </listitem>
89 <listitem>
90 <para>Section "Device". You may want to set some of the options
91 available for your selected video driver. A description of the driver
92 parameters is in the man page for your driver.</para>
93 </listitem>
94 <listitem><para>Section "Screen". Add a DefaultDepth statement such as:
95 <option>DefaultDepth 24</option>. In the SubSection for your
96 default depth, add a modes line such as:
97 <option>Modes "1600x1200" "1280x1024" "1024x768"</option>. The first
98 mode listed will normally be the starting resolution.</para>
99 </listitem>
100 </itemizedlist>
101
102 <para>Test the system with one of the following commands:</para>
103
104 <para>For <application>Xorg</application>:</para>
105<screen><userinput>X -config ~/xorg.conf.new</userinput></screen>
106
107 <para>For <application>XFree86</application>:</para>
108<screen><userinput>XFree86 -xf86config ~/XF86Config.new</userinput></screen>
109
110 <para>You will only get a gray background with an X-shaped mouse cursor,
111 but it confirms the system is working. Exit with
112 <keycap>Control+Alt+Backspace</keycap>. If the system does not work, take
113 a look at <filename>/var/log/Xorg.0.log</filename> or
114 <filename>/var/log/XFree86.0.log</filename> to see what went
115 wrong.</para>
116
117 <para>As the <systemitem class="username">root</systemitem> user, create
118 the configuration directory and move the configuration file to the new
119 directory:</para>
120
121 <para>For <application>Xorg</application>:</para>
122<screen role="root"><userinput>install -v -m755 -D ~/xorg.conf.new /etc/X11/xorg.conf</userinput></screen>
123
124 <para>For <application>XFree86</application>:</para>
125<screen role="root"><userinput>install -v -m755 -D ~/XF86Config.new /etc/X11/XF86Config</userinput></screen>
126
127 <para>As the <systemitem class="username">root</systemitem> user, create
128 <filename>.xinitrc</filename>:</para>
129
130<screen><userinput>cat &gt; ~/.xinitrc &lt;&lt; "EOF"
131<literal># Begin .xinitrc file
132xterm -g 80x40+0+0 &amp;
133xclock -g 100x100-0+0 &amp;
134twm</literal>
135EOF</userinput></screen>
136
137 <para>This provides an initial screen with a small clock that is
138 managed by a simple window manager, Tab Window Manager. For details of
139 <command>twm</command>, see the man page.</para>
140
141 <note>
142 <para>Both the default, and the BLFS configuration for
143 <application>Xorg</application> include <application>xterm</application>.
144 <application>Xorg</application>'s modular distribution no longer includes
145 <application>xterm</application>, and
146 as a result, the <command>startx</command> command will fail if you have
147 not installed <xref linkend="xterm2"/> when using the modular X Window
148 System. You can remove the <application>xterm</application> line in the
149 above config file to test the xserver, or install one of the other
150 terminal emulators and make appropriate changes.</para>
151 </note>
152
153 <indexterm zone="x-setup xconfig">
154 <primary sortas="e-AA.xinitrc">~/.xinitrc</primary>
155 </indexterm>
156
157 <para>When needed, the X Window System creates the directory
158 <filename class='directory'>/tmp/.ICE-unix</filename> if it does not
159 exist. If this directory is not owned by
160 <systemitem class="username">root</systemitem>,
161 the X Window System delays startup by a few seconds and also
162 appends a warning to the logfile. This also affects startup of other
163 applications. To improve performance, it is advisable to manually create
164 the directory before the X Window System uses it. Add the file creation
165 to <filename>/etc/sysconfig/createfiles</filename> that is sourced by
166 the <filename>/etc/rc.d/init.d/cleanfs</filename> startup script.</para>
167
168<screen role="root"><userinput>cat &gt;&gt; /etc/sysconfig/createfiles &lt;&lt; "EOF"
169/tmp/.ICE-unix dir 1777 root root
170EOF</userinput></screen>
171
172 <indexterm zone="x-setup xconfig">
173 <primary
174 sortas="e-etc-sysconfig-createfiles">/etc/sysconfig/createfiles</primary>
175 </indexterm>
176
177 <para>Start <application>X</application> with:</para>
178
179<screen><userinput>startx</userinput></screen>
180
181 <para>and a basic functional <application>X Window
182 System</application> should be displayed.</para>
183
184 <para>For a list of the package contents and a description of the commands,
185 see the sections in the <xref linkend='xfree86-contents'/>.</para>
186
187 </sect2>
188
189 <sect2 id='dri'>
190 <title>Checking Direct Rendering Infrastructure (DRI) Installation</title>
191
192 <indexterm zone="x-setup dri">
193 <primary sortas="g-DRI">DRI</primary>
194 </indexterm>
195
196 <para>DRI is a framework for allowing software to access graphics hardware
197 in a safe and efficient manner. It is installed in
198 <application>X</application> by default if you have a supported video card.
199 To check if DRI is installed properly, check the log file
200 <filename>/var/log/XFree86.0.log</filename> or
201 <filename>/var/log/Xorg.0.log</filename> for statements like:</para>
202
203<screen><literal>(II) R128(0): Direct rendering enabled</literal></screen>
204
205 <para>From an <command>xterm</command>, run <command>glxinfo</command>
206 and look for the phrase:</para>
207
208<screen><computeroutput>direct rendering: Yes</computeroutput></screen>
209
210 <para>You can also run the test program <command>glxgears</command>.
211 This program brings up a window with three gears turning. The
212 <command>xterm</command> will display how many frames were drawn every
213 five seconds, so this is a reasonable benchmark. The window is scalable,
214 and the frames drawn per second is highly dependent on the size of
215 the window.</para>
216
217 <indexterm zone="x-setup dri">
218 <primary sortas="b-glxgears">glxgears</primary>
219 </indexterm>
220
221 <indexterm zone="x-setup dri">
222 <primary sortas="b-glxinfo">glxinfo</primary>
223 </indexterm>
224
225 <para>For troubleshooting problems, check the DRI Users Guide at
226 <ulink url="http://dri.sourceforge.net/doc/DRIuserguide.html"/>.</para>
227
228 </sect2>
229
230<!-- ================================================== -->
231
232 <sect2 id='fonts'>
233 <title>Setting up Fonts</title>
234
235 <para>There are two font systems in the
236 <application>X Window System</application>. The first is the
237 core X font protocol, and the second is Xft. Toolkits that use the core
238 X font protocol include Xt, Xaw, Motif clones and GTK+-1.2. Toolkits that
239 use Xft include GTK+-2 and Qt and use <application>Fontconfig</application>
240 for control. Both font systems should be configured for proper font
241 coverage in the <application>X Window System</application>.</para>
242
243 <indexterm zone="x-setup fonts">
244 <primary sortas="e-etc-X11-xorg-conf">/etc/X11/xorg.conf</primary>
245 </indexterm>
246
247 <indexterm zone="x-setup fonts">
248 <primary sortas="e-etc-X11-XF86Config">/etc/X11/XF86Config</primary>
249 </indexterm>
250
251 <sect3>
252 <title>Core X Font Protocol</title>
253
254 <indexterm zone="x-setup fonts">
255 <primary sortas="g-core-x-font">Core X Font Protocol</primary>
256 </indexterm>
257
258 <para>The core X font protocol finds fonts from the server configuration
259 file (<filename>xorg.conf</filename> or <filename>XF86Config</filename>).
260 If no font paths exist in the configuration file, the server will fall
261 back to an internal hard-coded path. Assuming the prefix for your
262 <application>X</application> installation is
263 <filename class="directory">/usr/X11R6</filename>, the core fonts will
264 reside in subdirectories of <filename
265 class="directory">/usr/X11R6/lib/X11/fonts</filename>. For each
266 directory in the path, the server reads three files:</para>
267
268 <itemizedlist>
269 <listitem>
270 <para><filename>fonts.dir</filename> - maps font files to font
271 names&semi; updated with <command>mkfontdir</command></para>
272 </listitem>
273 <listitem>
274 <para><filename>fonts.alias</filename> - defines aliases (such as
275 "9x18") for existing fonts</para>
276 </listitem>
277 <listitem>
278 <para><filename>fonts.scale</filename> - lists scalable fonts&semi;
279 updated with <command>mkfontscale</command></para>
280 </listitem>
281 </itemizedlist>
282
283 <para>The core X fonts protocol uses names such as
284 <systemitem>-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1</systemitem>.
285 These fonts are rendered by the <application>X</application> server
286 without antialiasing. The server itself uses the "cursor" font for
287 painting the mouse cursor, and the protocol specification requires the
288 font "fixed" to be available.</para>
289
290 <para>Scalable fonts, such as Type1 and TrueType, are read from
291 <filename>fonts.scale</filename> files by the server. The core X font
292 system uses the "freetype" module for non-antialiased rendering of these
293 fonts. Ensure that the "freetype" module is loaded in the
294 <filename>XF86config</filename> or <filename>xorg.conf</filename>
295 file by adding it to the "Module" section:</para>
296
297<screen><literal>Section "Module"
298 ...
299 Load "freetype"
300 ...
301EndSection</literal></screen>
302
303 <para>The character set used is part of the font name, e.g. "-iso8859-1".
304 It is important that applications which support a non-English interface
305 specify the character set correctly so that the proper glyphs are used.
306 This can be controlled through the <application>X</application>
307 resources, which will be described later.</para>
308
309 <para>In some cases, applications rely upon the fonts named "fixed" or
310 something like "9x18". In these cases, it is important that the
311 <filename>fonts.alias</filename> file specifies the correct character
312 set. Users of ISO-8859-<replaceable>X</replaceable> encodings where
313 <replaceable>X</replaceable> != 1 should modify the
314 <filename>/usr/lib/X11/fonts/misc/fonts.alias</filename> file by
315 replacing the "iso8859-1" string with the proper encoding name. This is
316 accomplished by running the following command as the <systemitem
317 class="username">root</systemitem> user, substituting the proper value
318 for <replaceable>&lt;X&gt;</replaceable>:</para>
319
320<screen role="root"><userinput>sed -i 's,iso8859-1\( \|$\),iso8859-<replaceable>&lt;X&gt;</replaceable>\1,g' \
321 /usr/lib/X11/fonts/{75dpi,100dpi,misc}/fonts.alias</userinput></screen>
322
323 <para>Users of Cyrillic fonts have properly defined aliases in
324 <filename>/usr/lib/X11/fonts/cyrillic/fonts.alias</filename>. However,
325 this file will not be used unless the <filename
326 class="directory">/usr/lib/X11/fonts/cyrillic</filename> directory is
327 first in the font search path. Otherwise, the
328 <filename>/usr/lib/X11/fonts/misc/fonts.alias</filename> file will be
329 used.</para>
330
331 </sect3>
332
333 <sect3>
334 <title>Xft Font Protocol</title>
335
336 <indexterm zone="x-setup fonts">
337 <primary sortas="g-truetype">TrueType Fonts</primary>
338 </indexterm>
339
340 <para>Xft provides antialiased font rendering through
341 <application>Freetype</application>, and fonts are controlled from the
342 client side using <application>Fontconfig</application>. The default
343 search path is <filename class="directory">/usr/share/fonts</filename>
344 and <filename class="directory">~/.fonts</filename>.
345 When installing <application>X</application>, symlinks were created from
346 the <filename class="directory">OTF</filename> and <filename
347 class="directory">TTF</filename> <application>X</application> font
348 directories to <filename
349 class="directory">/usr/share/fonts/X11-{OTF,TTF}</filename>. This
350 prevents <application>Fontconfig</application> from using the poorly
351 rendered Type1 fonts or the non-scalable bitmapped fonts.</para>
352
353 <para><application>Fontconfig</application> searches directories in its
354 path recursively and maintains a cache of the font characteristics in
355 <filename>fonts.cache-1</filename> files in each directory. If the cache
356 appears to be out of date, it is ignored, and information is (slowly)
357 fetched from the fonts themselves. This cache
358 can be regenerated using the <command>fc-cache</command> command at any
359 time.</para>
360
361 <para><application>Fontconfig</application> uses names such as
362 "Monospace 12" to define fonts. Applications generally use generic font
363 names such as "Monospace", "Sans" and "Serif".
364 <application>Fontconfig</application> resolves these names to a font that
365 has all characters that cover the orthography of the language indicated
366 by the locale settings. Knowledge of these font names is included in
367 <filename>/etc/fonts/fonts.conf</filename>.</para>
368
369 <para>Standard scalable fonts that come with <application>X</application>
370 provide very poor Unicode coverage. You may notice in applications that
371 use <application>Xft</application> that some characters appear as a box
372 with four binary digits inside. In this case, a font set with the
373 available glyphs has not been found. Other times, applications that
374 don't use other font families by default and don't accept substitutions
375 from <application>Fontconfig</application> will display blank lines when
376 the default font doesn't cover the orthography of the user's language.
377 This happens, e.g., with <application>Fluxbox</application> in the
378 ru_RU.KOI8-R locale.</para>
379
380 <para>In order to provide greater Unicode coverage, it is recommended
381 that you install these fonts:</para>
382
383 <itemizedlist>
384 <listitem>
385 <para><ulink url="http://dejavu.sourceforge.net/">DejaVu fonts</ulink>
386 - These fonts are replacements for the Bitstream Vera fonts and
387 provide Latin-based scripts with accents and Cyrillic glyphs.
388 <application>Fontconfig</application> does not know about the DejaVu
389 fonts by default, so <filename>/etc/fonts/fonts.conf</filename> will
390 have to be edited for it to be recognized by the generic names such
391 as "Sans". This will be described below.</para>
392 </listitem>
393 <listitem>
394 <para><ulink
395 url="http://download.savannah.nongnu.org/releases/freefont/">FreeFont</ulink>
396 - This set of fonts covers nearly every non-CJK character, but is not
397 visually pleasing. <application>Fontconfig</application> will use it
398 as a last resort to substitute generic font family names.</para>
399 </listitem>
400 <listitem>
401 <para><ulink
402 url="http://corefonts.sourceforge.net/">Microsoft Core fonts</ulink>
403 - These fonts provide slightly worse Unicode coverage than FreeFont,
404 but are better hinted. Be sure to read the license before using
405 them. <application>Fontconfig</application> knows about them by
406 default.</para>
407 </listitem>
408 <listitem>
409 <para><ulink
410 url="http://cle.linux.org.tw/fonts/FireFly">Firefly New Sung font</ulink>
411 - This font provides Chinese coverage. However,
412 <application>Fontconfig</application> does not know about this font
413 by default.</para>
414 </listitem>
415 <listitem>
416 <para><ulink
417 url="http://cle.linux.org.tw/fonts/Arphic">Arphic fonts</ulink> -
418 A similar set of Chinese fonts to the Firefly New Sung font.
419 <application>Fontconfig</application> knows about these fonts by
420 default and will substitute them for generic family names.</para>
421 </listitem>
422 <listitem>
423 <para><ulink
424 url="http://sourceforge.jp/projects/efont/">Kochi fonts</ulink> -
425 These provide Japanese characters, and
426 <application>Fontconfig</application> knows about these fonts by
427 default.</para>
428 </listitem>
429 <listitem>
430 <para><ulink
431 url="http://kldp.net/projects/baekmuk/">Baekmuk fonts</ulink>
432 - These fonts provide Korean coverage, and
433 <application>Fontconfig</application> knows about these fonts by
434 default.</para>
435 </listitem>
436 </itemizedlist>
437
438 <para>The list above will not provide complete Unicode coverage. For
439 more information, please visit the <ulink
440 url="http://unifont.org/fontguide/">Unicode Font Guide</ulink>.</para>
441
442 <para>As an example, consider the installation of the DejaVu fonts. From
443 the unpacked source directory, run the following commands as the
444 <systemitem class="username">root</systemitem> user:</para>
445
446<screen role="root"><userinput>install -v -d -m755 /usr/share/fonts/dejavu &amp;&amp;
447install -v -m644 *.ttf /usr/share/fonts/dejavu &amp;&amp;
448fc-cache -v /usr/share/fonts/dejavu</userinput></screen>
449
450 <para>Earlier it was mentioned that <filename>/etc/fonts/fonts.conf</filename>
451 could be modified to use DejaVu using the default family names. Since
452 DejaVu is a replacement for Bitstream Vera fonts, it can be substituted
453 for that family. Visually inspect the <filename>fonts.conf</filename> to
454 see how fonts are grouped together under the generic family names and a
455 preference list is created. To replace Bitstream Vera with DejaVu, as the
456 <systemitem class="username">root</systemitem> user:</para>
457
458<screen role="root"><userinput>sed -i 's/&lt;family&gt;Bitstream Vera/&lt;family&gt;DejaVu/' /etc/fonts/fonts.conf</userinput></screen>
459
460<!--
461<screen><userinput><command>sed -i -e '/^&lt;\/fontconfig&gt;/i\
462&lt;dir&gt;/usr/X11R6/lib/X11/fonts/TTF&lt;/dir&gt;\
463&lt;dir&gt;/usr/X11R6/lib/X11/fonts/Type1&lt;/dir&gt;' /etc/fonts/local.conf</command></userinput></screen>
464 -->
465
466 <para condition="html" role="usernotes">User Notes:
467 <ulink url='&blfs-wiki;/XWindowSystemComponents'/></para>
468
469 </sect3>
470
471 </sect2>
472
473<!-- ================================================== -->
474
475 <sect2>
476 <title>Setting up Keyboards</title>
477
478 <para>In this version of <application>X</application>, non-Latin
479 keyboard layouts do not include Latin configurations as was previous
480 practice. To set up a keyboard for Latin and non-Latin input, change
481 the XkbLayout keyboard driver option in the InputDevice section
482 of the <filename>XF86Config</filename> or <filename>xorg.conf</filename>
483 file. For example:</para>
484
485<screen><literal>Section "InputDevice"
486 Identifier "Keyboard0"
487 Driver "Keyboard"
488 Option "XkbModel" "pc105"
489 Option "XkbLayout" "en_US,ru"
490 Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
491EndSection</literal></screen>
492
493 <para>In this example, you can use the <keycap>Alt+Shift</keycap>
494 combination to switch between keyboard layouts and use the Scroll Lock
495 LED to indicate when the second layout is active.</para>
496
497 </sect2>
498
499<!-- ================================================== -->
500
501 <sect2 id='xdm'>
502 <title>Setting up XDM</title>
503
504 <para><command>xdm</command> provides a graphical logon capability and
505 is normally set up in <filename>/etc/inittab</filename>. Most of the
506 information you need to customize <command>xdm</command> is found in
507 its man page. To execute <command>xdm</command> during bootup, change
508 the initdefault level to 5 and add the following lines to
509 <filename>/etc/inittab</filename>:</para>
510
511 <indexterm zone="x-setup xdm">
512 <primary sortas="b-xdm">xdm</primary>
513 </indexterm>
514
515<screen><literal># Run xdm as a separate service
516x:5:respawn:/usr/X11R6/bin/xdm -nodaemon</literal></screen>
517
518 <para>If <application>Linux-PAM</application> is installed on your
519 system, you should create a PAM entry for <command>xdm</command> by
520 duplicating the <command>login</command> entry using the following
521 command:</para>
522
523 <indexterm zone="x-setup xdm">
524 <primary sortas="e-etc-pam.d/xdm">/etc/pam.d/xdm</primary>
525 </indexterm>
526
527<screen role="root"><userinput>cp -v /etc/pam.d/login /etc/pam.d/xdm</userinput></screen>
528
529 </sect2>
530
531<!-- ================================================== -->
532
533 <sect2 id='x-resources'>
534 <title>Using X Resources</title>
535
536 <para>There are many options that can be set in
537 <application>X</application> and <application>X</application>
538 clients via resources. Typically resources are set in the
539 <filename>~/.Xresources</filename> file.</para>
540
541 <para>The layout of the <filename>~/.Xresources</filename> file
542 consists of a list of specifications in the form of</para>
543
544 <indexterm zone="x-setup x-resources">
545 <primary sortas="e-AA.xresources">~/.Xresources</primary>
546 </indexterm>
547
548<screen><literal>object.subobject[.subobject...].attribute: value</literal></screen>
549
550 <para>Components of a resource specification are linked together by
551 either <emphasis>tight</emphasis>, represented by a dot (.), or
552 <emphasis>loose</emphasis>, represented by an asterisk (*), bindings.
553 A tight binding indicates that the components on either side of the
554 dot must be directly next to each other as defined in a specific
555 implementation. An asterisk is a wildcard character that means that
556 any number of levels in a defined hierarchy can be between the components.
557 For example, X offers two special cursors: redglass and whiteglass. To
558 use one of these resources, you need to add the following line:</para>
559
560<screen><literal>Xcursor.theme: whiteglass</literal></screen>
561
562 <para>However, you can specify the background for all clients with:</para>
563
564<screen><literal>*background: blue</literal></screen>
565
566 <para>More specific resource variables will override less specific
567 names.</para>
568
569 <para>Resource definitions can be found in the man pages for each
570 respective client.</para>
571
572 <para>In order to load your resources, the <command>xrdb</command>
573 program must be called with the appropriate parameters. Typically,
574 the first time resources are loaded, you use:</para>
575
576<screen><userinput>xrdb -load &lt;filename&gt;</userinput></screen>
577
578 <para>To add resources to <application>X</application>'s database
579 in memory, use:</para>
580
581<screen><userinput>xrdb -merge &lt;filename&gt;</userinput></screen>
582
583 <para>The <command>xrdb</command> instruction is usually placed in
584 <filename>~/.xinitrc</filename> or <filename>~/.xsession</filename>.
585 To get more information, see the <command>xrdb</command> man page.</para>
586
587 <indexterm zone="x-setup x-resources">
588 <primary sortas="b-xrdb">xrdb</primary>
589 </indexterm>
590
591 </sect2>
592
593</sect1>
Note: See TracBrowser for help on using the repository browser.