Team LiB
Previous Section Next Section

Hack 51. Ultimate Terminal Transparency

You want a lightweight terminal, but you want it to look cool.

You can set a number of terminal programs to have their own graphics backgrounds or to be "transparent," so that your wallpaper shows through, which really makes the terminal look good. Transparency seems to be the trendy look these days.

The only problem with true transparency is that you need to stick with monochromatic wallpaper for it to work. If you have wallpaper with both bright and dark patterns, you're in trouble (Figure 7-1). It doesn't matter if you set your text color to black or white. Depending on where the text shows up on your colorful wallpaper, you'll be able to read some text, and other text will blend into the background and disappear.

Figure 7-1. A hard-to-read transparent terminal


Sure, Figure 7-1 looks pretty, but one could go blind trying to read the text. Heavyweight programs such as KDE Konsole or a GNOME terminal solve this problem nicely. But it seems counterproductive to run a lightweight window manager only to load heavyweight terminals just to get a cool tinted transparency. Xorg (a fork of the XFree86 X Windows project) has experimental transparency features [Hack #34] that will solve this problem for all terminals, but it is currently unstable. Until Xorg works out the bugs, aterm, urxvt, and some settings in .Xdefaults come to the rescue.

7.4.1. Tint Your urxvt

At least two relatively lightweight terminalsa Unicode version of rxvt, called urxvt, and atermprovide the ability to tint the transparent background. A project called mrxvt that lets you open multiple terminals in a single window also offers this feature. But the mrxvt project is such a quickly moving target I cannot recommend any settings until it matures further.

In the case of urxvt, the terminal will still be transparent so that it shows the desktop wallpaper as its background. But urxvt can modify the background by applying a colored tint to adjust the view of the desktop wallpaper. You define the color of the tint and the level of shading of the tint, and you can do it all in your .Xdefaults file [Hack #50] so that you never have to remember the command-line parameters. Starting with urxvt, here are the settings to add to your ~/.Xdefaults file to get the results, as shown in Figure 7-2.

urxvt*inheritPixmap: True
urxvt*tintColor: green
urxvt*shading: 70
urxvt*fading: 70

The added green tint with a shading value of 70 makes a huge difference in the legibility of the text, doesn't it?

Here are two more tips: I find it very useful to set the termName to rxvt. Some versions of Linux do not recognize urxvt as a valid terminal type and therefore do not format text properly. Also, urxvt has a resource setting called fading that determines how much the text will fade when the window loses focus.


Figure 7-2. Transparent and tinted urxvt terminal


7.4.2. aterm Is a Beautiful Thing to Tint

The terminal shown in Figure 7-2 is urxvt, but aterm looks identical with the suggested settings. Here's all you have to do to get the same useful transparency from aterm. Fire up your favorite editor, add these settings to your .Xdefaults file, and then run aterm:

Aterm*transparent: true
Aterm*tintingType: true
Aterm*tinting: green
Aterm*shading: 80

If you have your system set up to use multiple text colors, one of those colors might be difficult to read no matter what color you pick for a tint. Pick dark green, and the dark green text is hard to read. Pick dark blue, and the dark blue text is hard to read. I simply tweak the shading values to make the tint lighter or darker until I find a happy medium where I can read all the text colors. I recommend you do the same if you like this effect.

    Team LiB
    Previous Section Next Section