To test the Xorg installation,
issue startx
. This
command brings up a rudimentary window manager called twm with three xterm windows and one
xclock window. The xterm window in the upper left is a login
terminal and running exit
from this terminal will exit the X
Window session. The third xterm window may be obscured on
your system by the other two xterms.
Generally, there is no specific configuration required for Xorg, but customization is possible. For details see the section called “Setting up Xorg Devices” below.
Until recently (relatively speaking) almost every X Window installation you performed or came
across was installed in the /usr/X11R6
directory. That was the standard for
years. Developers picked up on this and wrote their package
installation scripts looking for X
in the standard location. Things have changed and the trend is to
now install X in /usr
. Some people want to install it in a custom
location.
Many package developers have not caught up to the change and their
packages are still trying to find X in /usr/X11R6
and subsequently fail when you try to build the package. Though for
most packages it is not difficult to 'hack' the installation script
to fix the problem, that is not the long term solution to the
problem. Upstream developers need to modernize their installation
scripts and eliminate the problem altogether.
Until then, you can create a symbolic link to satisfy the
/usr/X11R6
requirement so that you
won't be inconvenienced with a package build failure due to this
known issue. If you wish to create the symlink, issue the following
command as the root
user (ensure
you modify <$XORG_PREFIX>
appropriately):
ln -vsf <$XORG_PREFIX>
/usr/X11R6
Xft provides antialiased font rendering through Freetype, and fonts are controlled from the
client side using Fontconfig. The
default search path is /usr/share/fonts
and ~/.fonts
. Fontconfig searches directories in its path
recursively and maintains a cache of the font characteristics in
fonts.cache-1
files in each
directory. If the cache appears to be out of date, it is ignored,
and information is (slowly) fetched from the fonts themselves. This
cache can be regenerated using the fc-cache command at any time. You
can see the list of fonts known by Fontconfig by running the command fc-list.
If you've installed Xorg in any
prefix other than /usr
, the
X fonts were not installed in a
location known to Fontconfig. This
prevents Fontconfig from using the
poorly rendered Type 1 fonts or the non-scalable bitmapped fonts.
Symlinks were created from the OTF
and TTF
X font directories to /usr/share/fonts/X11-{OTF,TTF}
. This allows
Fontconfig to use the OpenType and
TrueType fonts provided by X
(which are scalable and of higher quality).
Fontconfig uses names such as
"Monospace 12" to define fonts. Applications generally use generic
font names such as "Monospace", "Sans" and "Serif". Fontconfig resolves these names to a font that
has all characters that cover the orthography of the language
indicated by the locale settings. Knowledge of these font names is
included in /etc/fonts/fonts.conf
.
Fonts that are not listed in this file are still usable by
Fontconfig, but they will not be
accessible by the generic family names.
Standard scalable fonts that come with X provide very poor Unicode coverage. You may notice in applications that use Xft that some characters appear as a box with four binary digits inside. In this case, a font set with the available glyphs has not been found. Other times, applications that don't use other font families by default and don't accept substitutions from Fontconfig will display blank lines when the default font doesn't cover the orthography of the user's language. This happens, e.g., with Fluxbox in the ru_RU.KOI8-R locale.
In order to provide greater Unicode coverage, it is recommended that you install these fonts:
DejaVu fonts - These fonts are replacements for the Bitstream Vera fonts and provide Latin-based scripts with accents and Cyrillic glyphs.
FreeFont - This set of fonts covers nearly every non-CJK character, but is not visually pleasing. Fontconfig will use it as a last resort to substitute generic font family names.
Microsoft Core fonts
- These fonts provide slightly worse Unicode coverage than
FreeFont, but are better hinted. Be sure to read the license
before using them. These fonts are listed in the aliases in
the /etc/fonts/fonts.d
directory by default.
Firefly New Sung
font - This font provides Chinese coverage. This font is
listed in the aliases in the the /etc/fonts/fonts.d
directory by default.
Arphic fonts - A
similar set of Chinese fonts to the Firefly New Sung font.
These fonts are listed in the aliases in the /etc/fonts/fonts.d
directory by default.
Kochi fonts -
These provide Japanese characters, and are listed in the
aliases in the /etc/fonts/fonts.d
directory by default.
Baekmuk fonts - These
fonts provide Korean coverage, and are listed in the aliases
in the /etc/fonts/fonts.d
directory by default.
The list above will not provide complete Unicode coverage. For more information, please visit the Unicode Font Guide.
As an example, consider the installation of the DejaVu fonts. From
the unpacked source directory, run the following commands as the
root
user:
install -v -d -m755 /usr/share/fonts/dejavu && install -v -m644 *.ttf /usr/share/fonts/dejavu && fc-cache -v /usr/share/fonts/dejavu
For most hardware configurations, modern Xorg will automatically get the server configuration correct without any user intervention. There are, however, some cases where auto-configuration will be incorrect. Following are some example manual configuration items that may be of use in these instances.
For most input devices, no additional configuration will be necessary. This section is provided for informational purposes only.
A sample default XKB setup could look like the following
(executed as the root
user):
cat > /etc/X11/xorg.conf.d/xkb-defaults.conf << "EOF" Section "InputClass" Identifier "XKB Defaults" MatchIsKeyboard "yes" Option "XkbOptions" "terminate:ctrl_alt_bksp" EOF
Again, with modern Xorg, little or no additional configuration is
necessary. If you should need extra options passed to your video
driver, for instance, you could use something like the following
(again, executed as the root
user):
cat > /etc/X11/xorg.conf.d/videocard-0.conf << "EOF" Section "Device" Identifier "Videocard0" Driver "radeon" VendorName "Videocard vendor" BoardName "ATI Radeon 7500" Option "NoAccel" "true" EndSection EOF
Another common setup is having multiple server layouts for use in different environments. Though the server will automatically detect the presence of another monitor, it may get the order incorrect:
cat > /etc/X11/xorg.conf.d/server-layout.conf << "EOF" Section "ServerLayout" Identifier "DefaultLayout" Screen 0 "Screen0" 0 0 Screen 1 "Screen1" LeftOf "Screen0" Option "Xinerama" EndSection EOF
Last updated on 2011-12-12 00:31:25 +0000