CLI Magic: An extreme term makeover

51

Author: Joe Barr

I know a lot of you GUI lounge-lizards stay away from the CLI — not because it’s hard to use — but simply because you think you can’t do any stylin’ there. Think again, you retro-tard neo-geeks. This week we’ll show you a little CLI magic that will allow you to do an extreme makeover on your terminal window.

That bland desktop wallpaper in your GUI can get pretty boring, especially if it’s the only visual relief you’re getting from the humdrum ones and zeroes humming beneath it. But it’s pretty easy to spice up your drab existence with a dazzling terminal window for your CLI time. Here’s how.

Take the aterm

There are several terminals you can choose for glamor. We’re going to use aterm, the AfterStep terminal emulator. It’s light, fast, and powerful, and it can be tweaked ’til the cows come home. That tweaking begins in earnest before you even compile the beast. I recommend you follow along with the example given here to get it running on your desktop, then go back later and tweak it to your own taste.

I downloaded aterm 0.4.2 from the project Web site on SourceForge. Building the module requires the usual ./configure, make, and make install routine, but pay special attention to the configure step. That’s where most of the secret sauce gets added to the mix.

Here’s what I used to configure my build:


./configure --enable-fading --enable-background-image --enable-menubar --enable-graphics --enable-half-shadow --with-x

Further down in the story, you’ll see three thumbnails of how aterm can look based on that build configuration. The first is a generic aterm window, the second is aterm using a digital image for a background, and the third is aterm in transparent mode. All the differences between the three are driven by either command line options or configuration files. Click on any of the three to enlarge it.

Aterm – Generic
Aterm – Background
Aterm – Transparent

If and when you want to tinker with other configuration options, type ./configure -help for the complete list of build-time options. Part of that list is shown below:


Usage: configure [options] [host]
Options: [defaults in brackets after descriptions]

Configuration:
--cache-file=FILE cache test results in FILE
--help print this message
--no-create do not create output files
--quiet, --silent do not print `checking...' messages
--version print the version of autoconf that created configure

Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--x-includes=DIR X include files are in DIR
--x-libraries=DIR X library files are in DIR
--enable and --with options recognized:
--enable-utmp enable utmp/utmpx support
--enable-wtmp enable wtmp support if you have utmp/utmpx support
--enable-background-image enable background pixmaps
--enable-transparency enable transparent background [yes]
--enable-fading enable colors fading when off focus [no]
--enable-menubar enable Menubar
--enable-graphics enable aterm own
graphics mode (see src/graphics)
--enable-next-scroll enable NeXT style scrollbar [yes]
--enable-xterm-scroll revert to Xterm style scrollbar
--enable-half-shadow use half width/height shadows on non-Xterm scrollbar
--enable-kanji enable kanji support
--enable-big5 enable big5 support
--enable-greek enable greek keyboard support
--enable-thai enable thai support
--enable-ttygid enable tty setting to group "tty" - use only if
your system uses this type of security
--disable-backspace-key disable handling of the backspace key
--disable-delete-key disable handling of the delete key
--disable-resources disable all resource checking
--enable-xgetdefault enable resources via X instead of our small version
--disable-memset disable memset() function, use your system's instead
--disable-swapscreen disable swap screen support
--disable-keepscrolling disable continual scrolling on scrollbar arrow press
--disable-mousewheel disable scrolling via mouse wheel or buttons 4 & 5
--enable-old-selection enable v2.20 (and prior) mouse selection
- this implies old word selection
--enable-old-wordselect enable v2.20 (and prior) mouse selection of words
--enable-dmalloc enable Gray Watson's malloc - for debugging use
--enable-dlmalloc enable Doug Lea's malloc - for production use
- enable only one malloc package
--with-term=NAME set the terminal to NAME (default "xterm")
--with-terminfo=PATH set the path to the terminfo tree to PATH

After you’ve finished configuring and installing the program, you might be a little disappointed the first time you run aterm. Do not despair, even though it looks bland without runtime options. The magic is in it, but you have to tell aterm what you want it to look like.

There are two ways to do that: You can use arguments following the aterm command, or you can preconfigure the run-time options and save them in ~/.Xdefaults or ~/.Xresources. Remember how long that list of configuration options is? The list of run-time arguments is just about as long.

I’m going to cover only run-time options, and only the run-time options I used to produce the three variations of aterm shown here. Let’s start with the Plain Jane version. The only argument I used with it was -g 120x40. That sets the aterm window geometry at 120 columns and 40 rows.

The second aterm uses an existing image for its background. I added two more options to the Plain Jane command line to produce it, like this:


aterm -g 120x40 -sl 1024 -pixmap wallpaper/future.xpm

The -sl option sets the number of scroll lines for the terminal, and the -pixmap option specifies a digital image to be used as the background.

The third aterm variation shown — transparency — drops the -pixmap option and adds a few others:

  • -tr This turns on the transparency mode
  • -tint yellow Tints the transparency yellow
  • -fade 50 Fades colors specified amount when Aterm does not have focus
  • -fg white Sets the foreground color white

For the complete list of options you can set on the command line, or in a resource file, do the man thing. Another resource I found useful getting started with aterm is this article at LinuxReview.org.