Polishing the terminal window with Bashish

Color My Shell


Bashish adds a dash of style to the command line.

By Frank Wieduwilt

Orchidpoet, Fotolia

If you are a regular command line user, you may appreciate the spartan appearance of the terminal window. But for occasional shell users, or readers who would prefer a more playful approach, Bashish [1] opens a treasure trove of options. Bashish gives your terminal window a colorful ASCII graphic background.

Bashish lets you liven up the appearance of terminal programs such as Gnome Terminal, Xterm, Rxvt, Rxvt Unicode, Aterm, Mlterm, and the Linux Console, and you can change a limited range of settings such as the title bar in the Konsole KDE terminal emulation window. Bashish developer, Thomas Eriksson, is planning additional support for Konsole. He recommends using the bash shell, although the program will support other shells such as Zsh and Tcsh.

If possible, the terminal should support the Unicode character set. Many of the themes that come with the Bashish package include characters such as lines or playing card symbols that are not supported by legacy code pages such as 8859-1 or 8859-15.

To install a functional version of Bashish, you will need a recent version of the Bourne Again Shell (Bash), version 2.04 or newer. You'll also need a recent version of your terminal program.

We were unable to use Bashish with the Rxvt version included with Mandriva 2006. The terminal program crashed with most of the themes we tried. In contrast, the version of Bashish provided with Ubuntu 6.06 worked without any trouble, as did the Rxvt version with Suse 10.1. After we switched to the Rxvt Unicode version available on the web [3], Bashish finally worked on Mandriva.

Installation

To install Bashish, first unpack the source code archive, bashish-2.0.5.1.tar.gz, and then go through the normal hat-trick of ./configure, make, and make install to build and install. After completing the basic setup, give the command bashish in a terminal program. The tool will now ask you which shell you prefer and will configure the shell to automatically load Bashish next time you launch it.

You can now launch a new shell by entering the exec bash command. The new shell will reflect the default Bashish settings, which call for a light blue font on a black background. To remove Bashish, just launch the program with the --uninstall flag.

Shell Colors

Bashish groups shell enhancements in what are called themes. A theme includes the data for the background graphic and the prompt. To launch the shell with a theme, first run the Bashishtheme tool. The initial dialog asks you to specify whether you will be using the prompt for the shell in general, or whether you would simply like to apply the changes to a specific program.

If you are just redressing the shell, select the prompt theme at the command prompt entry from the menu. A list appears, which lets you specify the theme details. After deciding on a design and possibly modifying the background color, you can quit the configuration program. The terminal window should look completely different at this point (Figure 1).

Figure 1: The Rxvt Unicode terminal emulation window with the Urbandawn theme.

It is worth your while to experiment with the backgrounds that come with the distribution. Nostalgia fans might like to check out the prompts with the computer/ prefix. For example, you can change the prompt to look like a DOS prompt; Bashish even converts the slashes in pathnames to backslashes (Figure 2).

Figure 2: A Rxvt terminal masquerading as the legacy DOS operating system.

In the blobs of color that Bashish distributes between the prompt and normal program output, you can be more selective by assigning themes to specific applications. To do so, select the application theme selected application item in the Bashish theme main menu. This option takes you to a dialog where you can enter the name of the required program and then select one of the themes. Bashish will now save a launcher script that uses the program name in the program's path.

When the program is launched, the launcher script first adds the selected theme to the shell before going on to the launch the software. When you quit the program, the script reinstates the previous shell status. The launcher script will not prevent from you from passing in parameters to the software you are launching.

Bashish stores launcher scripts in the ./bashish/launcher directory below a user's home directory. Themes for specific applications are located in ./basish/bt/app. Bashish stores a directory with the name of the program.

Unfortunately, neither the themes nor the prompts were particularly stable. Some prompts prevent even the output of simple commands such as less or ps from displaying on screen. The Urbandawn theme shown in Figure 1 occasionally prevented data output on the terminal. Bashish also miscalculates the size of the terminal window from time to time, leaving you with just part of the program output.

Some programs, such as Playmp3list, will not launch on any Bashish theme apart from the default. Playmp3list crashed with a segmentation fault no matter what other themes we tried. And the text mode browser Elinks died, refusing to launch if we had enabled a Bashish theme.

Do-It-Yourself Themes

In a default installation from the source code, the theme files are located in /usr/local/share/bashish/themes. The binary elements are stored in separate TGZ archives with a suffix of bt; of course, you can't edit files in this format. If you wish to modify a theme, start by enabling the theme in Bashishtheme. You will then discover the theme components in the ~/.bashish/bt/cache/ directory. Now copy the text files to a new directory and load them for editing with an editor that supports Unicode.

The Theme file contains details of the author and the colors that you will be using; Prompt.bash gives you the prompt definition, including the graphics that Bashish will display on screen. The Bashish commands are documented at [4]. The documentation lacks structure and has some gaps, which sometimes leaves you with no alternative but trial and error. The easiest approach is to use an existing theme as a starting point for your experiments.

After completing your modifications, change to the directory with the theme files and type bashishtheme save. If you have created a new theme, Bashish will ask where you would like to save the theme you just created.

Conclusions

Bashish adds color and variety to the daily gray of the terminal window. The Bashish program is still far from bug-free; some Bashish themes prevent data output on the terminal, and some programs just crash at the sight of Bashish. Another problem is that the Bashish program documentation is disorganized, making it difficult to create your own themes unless you are willing to experiment.

INFO
[1] Bashish: http://bashish.sourceforge.net
[2] Dialog: http://hightek.org/dialog/
[3] Rxvt Unicode: http://software.schmorp.de/pkg/rxvt-unicode
[4] Bashish documentation: http://bashish.sourceforge.net/doc.html
THE AUTHOR

Frank Wieduwilt originally studied history and has been working for several years as a freelance technical author for several publishing companies in Berlin, Germany, where he writes manuals for database software solutions. Frank is a regular contributor to Linux Magazine, specializing in SOHO topics such as office and graphics programs.