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