(M)  s i s t e m a   o p e r a c i o n a l   m a g n u x   l i n u x ~/ · documentação · suporte · sobre

  Next Previous Contents

8. The Bash Prompt Package

8.1 Availability

The Bash Prompt package is available at http://bash.current.nu, and is the work of several people, co-ordinated by Rob Current (aka BadLandZ). The package is an early beta, but offers a simple way of using multiple prompts (or themes), allowing you to set prompts for login shells, and for subshells (ie. putting PS1 strings in ~/.bash_profile and ~/.bashrc). Most of the themes use the extended VGA character set, so they look bad unless they're used with VGA fonts (which aren't the default on most systems).

8.2 Xterm Fonts

To use some of the most attractive prompts in the Bash Prompt package, you need to get and install fonts that support the character sets expected by the prompts. These are "VGA Fonts," which support different character sets than regular Xterm fonts. Standard Xterm fonts support an extended alphabet, including a lot of letters with accents. In VGA fonts, this material is replaced by graphical characters - blocks, dots, lines. I asked for an explanation of this difference, and Sérgio Vale e Pace (space@gold.com.br) wrote me:

I love computer history so here goes:

When IBM designed the first PC they needed some character codes to use, so they got the ASCII character table (128 numbers, letters, and some punctuation) and to fill a byte addressed table they added 128 more characters. Since the PC was designed to be a home computer, they fill the remaining 128 characters with dots, lines, points, etc, to be able to do borders, and grayscale effects (remember that we are talking about 2 color graphics).

Time passes, PCs become a standard, IBM creates more powerful systems and the VGA standard is born, along with 256 colour graphics, and IBM continues to include their IBM-ASCII characters table.

More time passes, IBM has lost their leadership in the PC market, and the OS authors dicover that there are other languages in the world that use non-english characters, so they add international alphabet support in their systems. Since we now have bright and colorful screens, we can trash the dots, lines, etc. and use their space for accented characters and some greek letters, which you'll see in Linux.

8.3 Changing the Xterm Font

Getting and installing these fonts is a somewhat involved process. First, retrieve the font(s). Next, ensure they're .pcf or .pcf.gz files. If they're .bdf files, investigate the "bdftopcf" command (ie. read the man page). Drop the .pcf or .pcf.gz files into the /usr/X11R6/lib/X11/fonts/misc dir (this is the correct directory for RedHat 5.1 and Slackware 3.4, it may be different on other distributions). "cd" to that directory, and run the "mkfontdir" command. Then run "xset fp rehash". Sometimes it's a good idea to go into the fonts.alias file in the same directory, and create shorter alias names for the fonts.

To use the new fonts, you start your Xterm program of choice with the appropriate command to your Xterm, which can be found either in the man page or by using the "--help" parameter on the command line. Popular terms would be used as follows:

xterm -font <fontname>
OR
xterm -fn <fontname> -fb <fontname-bold>
Eterm -F <fontname>
rxvt -fn <fontname>

VGA fonts are available from Stumpy's ANSI Fonts page at http://home.earthlink.net/~us5zahns/enl/ansifont.html (which I have borrowed from extensively while writing this).


Next Previous Contents