What is X?
XFree86 Log
Access
ZappingGamma adjustment
tmpwatch
DRI and GLX
Security
Fonts
Some font sources
FontConfig
Ghostscript
xfs
Adding fonts to OpenOffice
Simply put, X is a standard system for drawing stuff on computer screens. If you are reading this page on either a Unix or Macintosh system, you are most likely using X.
X is an open standard. Several different implementations are available.
X was designed for remote display. That means the computer figuring out what to draw can be different than the one the screen is plugged in to. The terminology for X can be a little confusing, so here it is: an X Server is the part that owns the screen. The X Client knows what to draw, but doesn't own the screen, and so must ask the X server to draw its stuff. The X Server and X Client may be running on different computers. For more details on how to do this, set the DISPLAY variable on the X client -- see man X and man xhost for details.
X is not a window manager. While X can draw basic windows, the fancy gizmos that give you multiple desktops, control menus, and beautiful skins are part of add-on software called the window manager. There are more of these than there are X implementations, and they vary in complexity and features.
The Xorg
log is /var/log/Xorg.0.log
(run man Xorg for
details).
The
XFree86 log is /var/log/XFree86.0.log
(run man XFree86
for details).
The X
configuration file is: /etc/X11/xorg.conf
(see man xorg.conf)
The X
configuration file is: /etc/X11/XF86ConfigYou can restart your X session with Ctrl+Alt+Backspace, which means that all of your windows are closed and then X restarts. This feature allows you to regain control of your system when something has gone wrong. But it can be very annoying if you type that key combination accidentally, and usually it doesn't help when you need it because your keyboard is locked-up, too. I find it more convenient to disable it altogether by adding this to my X configuration file, /etc/X11/xorg.conf:
Section "ServerFlags"
Option "DontZap" "on"
EndSection
Also see Gentoo TIP Fix the Login Security Hole.
X creates a pipe called /tmp/.X11-unix/X0 and it is used to open new windows. The modification time on it never changes, so if you have mounted /tmp with noatime, and have tmpwatch remove things by modification time, then are after a few days tmpwatch will delete it -- and then you can't open new windows! A couple other things create sockets in /tmp, and are likely to stop working around the same time. You can see list of all programs currently using the sockets in /tmp with netstat --unix --program | grep tmp | less.
How to recover: forget it! Restart X and the other daemons.
Best to put system in runlevel 1 and kill all non-root processes.
Prevention: Do not use the --all option with tmpwatch.
Suspend
currently does not work well with DRI (locks up system).
My system
seemed to hang a lot when I leave it
idle for a long
time. Other times, it hangs when I am using it. When this happens, it
does not respond to the keyboard or mouse, and there is no telltale
clue in /var/log/messages.
One suspect is DRI (Direct Rendering Interface), which, I read in an
e-mail, is frequently abused by screensavers. Currently, I use it only
for games. I commented out the following line in /etc/X11/XF86Config:Section "Module"
...
# Load "dri"
...
EndSection
The
Gentoo default is to disable TCP listening.
"/etc/X11/gdm/gdm.conf"
controls
external access to the X
server when using the Gnome Display Manager (gdm). The default is to
permit
external access with some flimsy security. To disable external access
completetly,
add the following colored text:[servers]
0=/usr/bin/X11/X -nolisten tcp
[server-Standard]
name=Standard server
command=/usr/X11R6/bin/X -nolisten tcp
flexible=true
[server-Terminal]
name=Terminal server
command=/usr/X11R6/bin/X -terminate -nolisten tcp
flexible=false
handled=false
Also see Xserver(1), XFree86(1), X(7x), and Bill Moss' page.
Some font sources
FontConfig
Gentoo uses FontConfig. To add new fonts, either Type1 or TrueType:
- Create a subdirectory under one of the directories listed at the top of "/etc/fonts/fonts.conf". Example: /usr/share/fonts/cheapskate.
- Put fonts in the directory.
- That's it! FontConfig figures out when fonts are added or removed. You can list known fonts with "fc-list | sort | less"
Ghostscript
Adding fonts to Ghostscript:
- Create a file in /etc/env.d called "99gs".
- Into the file put:
GS_FONTPATH="/usr/share/fonts/cheapskate:/usr/share/fonts/..."
including each directory of fonts that you want Ghostscript to use. Could be either Type1 or TrueType.
- Run env-update.
xfs
RedHat configures the distribution to run the X Font Server, xfs, as a separate process.
- Use chkfontpath to list and modify the current font path.
- The xfs configuration file is: "/usr/X11R6/lib/X11/fs/config"
- For fast start-up, I set "deferglyphs = all"
- For security, I set "no-listen = tcp"
- Because I have a high-resolution screen, I set "default-resolutions = 100,100" (do not believe that by setting the default resolution to 100 dpi that you can get rid of the 75 dpi fonts -- if you do, your system will break).
- Debugging font problems is a pain. This is a reasonably good troubleshooting guide: http://feenix.dyndns.org/xstuff/xfs.html. Problems I have had:
- Problem: After adding new fonts with chkfontpath, xfs starts, but no fonts are shown in xfontsel. Everything checks out OK otherwise. Solution: Restart X.
- Problem: New fonts don't appear in the font selector utility. Solution: Check that the "fonts.dir" file in the new font directory contains something other than just the number "0". If the fonts came with a "fonts.dir" file, then touch the file after installation so that the xfs start up script will not rebuild it.
Installing Windows TrueType fonts:
- Put the fonts into an existing font directory (run chkfontpath to find out what it is), or create a new directory.
- Add new directories in "/usr/X11R6/lib/X11/fs/config".
- Restart XFS: "/etc/init.d/xfs restart".
- It's a good idea to restart your X session after restarting XFS.
Adding fonts to Ghostscript:
- I renamed "/usr/share/ghostscript/7.05/lib/Fontmap" to "Fontmap.GS" to isolate the fonts that came with Ghostscript.
- I created a new "Fontmap" file with the lines:
%!
% See Fontmap.GS for the syntax of real Fontmap files.
(Fontmap.GS) .runlibfile
(Fontmap.local) .runlibfile
(Fontmap.share) .runlibfile- "Fontmap.local" contains fonts from "/usr/local/share/fonts".
- "Fontmap.share" contains fonts from "/usr/share/fonts".
- Add more fontmap files as needed. You need the font's PFB file, which TrueType does not have. See the Font HOWTO.
Adding fonts to OpenOffice
| Copyright © 2003-2004 Craig Lawson | ||
| Index | ![]() |