ALINK="#FF0000"> [ Table of Contents ] [ Front Page ] [ Prev ] [ Linux Gazette FAQ ] [ Next ]

"Linux Gazette...making Linux just a little more fun!"


Tweaking Eterm

By Edward Livingston-Blade


Try this string with Eterm:

Eterm -W -O --shade 60 --home-on-echo no --home-on-input

Here's the reasoning. Oh, and I'm doing all of this with "Eterm-0.8-9.i386.rpm". If something I do here doesn't work for you, consider the possibility that you're using a newer or (less likely) older version, and that the author(s) has changed something relevant.

The "-O" gives a pseudo-transparent Eterm. The terminal remembers your wallpaper at the time the terminal was created, though, so if you use any sort of automated wallpaper changer, you're going to end up with the wallpaper one thing and the background on the Eterm another. Same thing if you move the Eterm to a desktop with different wallpaper. The "-W" causes the Eterm to watch the desktop for changes to the wallpaper, fixing this behavior. The "--shade 60" darkens the Eterm's background. This is a big help if you use wallpaper with bright colors... you can shade the Eterm background to the point where you can actually use the terminal. :-) The "60" in "--shade 60" is the percentage amount of shading applied to the background... "0" is no shade, "100" is black. A value of "60" works well for me, you might want to tinker.

If you are scrolled up in an Eterm window, and the system generates new text, Eterm will automatically scroll you down as far as it can go so that you 1) are made aware that there's new output and 2) can read it immediately. (I should add here that this may just be the default for the Red Hat package I'm using and not the official Eterm download. The man page for Eterm warns that "In keeping with the freedom-of-choice philosophy, options may be eliminated or default values chosen at compile-time, so options and defaults listed may not accurately reflect the version installed on your system". Now, regarding the above-mentioned "jump to bottom on output" feature, that same man page reads as if the option is inactive by default. On my Eterm, it's not... it's active. In fact, the POSIX "-H" option that controls this is useless to me because my Red Hat package Eterm behaves the same way whether "-H" is present or not. :-( So between the man page warning and the behavior I see, I tend to think that my Red Hat package has "-H" on by default.) I don't like this behavior. I've been using "gnome-terminal" for a while, and when you scroll up in a gnome-terminal window, it stays scrolled whether the system is generating new text or not. (Although it WILL appear to be scrolling down as text scrolls up past your point-of-view, displaced by the new text the system is generating. That'll probably make more sense once you've seen it happen.) I like that because, for example, if I'm running a "find" and want to scroll up and examine an old directory listing while the "find" is finding, I don't have to fight the terminal as much to keep my point-of-view on the directory listing. Therefore, "--home-on-echo no". (The long option "--home-on-echo" is equivalent to the POSIX option "-H", but since, as I discuss above, "-H" appears to be compiled into the Eterm Red Hat package, the long option is the only way to turn the option off.) Now, something else weird. Normally, if YOU generate text (rather than the system) while scrolled up in an Eterm window, Eterm will automatically scroll you down so you can read what you're typing. I like this behavior. However, for some reason that's opaque to me, as soon as you use "--home-on-echo no", this behavior stops, and the point-of-view stays where you scrolled it to, whether the system OR you generates new text. It's as if turning "--home-on-echo" off somehow forces "--home-on-input" off as well, even though the latter option had defaulted to "on" previously. Anyway, using "--home-on-input" in the command string reinforces what I want and gets the Eterm back in line.

correction: Eterm doesn't QUITE mimic the behavior of gnome-terminal, even after these tweaks... when you are scrolled up, gnome-terminal will "lock" the view in place until the buffer fills, then text will scroll. Text in an Eterm window will scroll regardless of the buffer. (Again, that'll probably make more sense once you've seen it happen.) I like gnome-terminal's behavior better, so if anybody knows or can figure out a way to make Eterm work exactly the same, please let me know.

I use "ls --color". While the default color choices are fine against a solid background, I find them less than optimal against my wallpaper, even with "Eterm --shade 60". (And much higher than that, and why bother?) So I'm trying to figure out how to tweak the default Eterm colors to get maximum visibility across as much of the enormous range of possible color contrasts brought to my desktop by my collection of wallpaper as I can. I'll swap green and white, as I find that green has better contrast with the rest of the spectrum in general than white. I'll swap the two rather than just changing white to green because files with execute permission are listed in green, and there's no sense in sacrificing that color cue. I'll also lighten the blue, as it's dark enough to have lousy contrast with most of the spectrum. These changes aren't necessarily for everyone... I'm tweaking the Eterm colors so they work better with my eyes when I'm using Eterm's pseudo-transparency feature. You may find that different choices work best for you. Nevertheless, please read on and learn from my mistakes. :-) Lastly, once I've got all this "escape sequences" stuff worked out, I'll probably try something creative with my bash prompt. OK, the first thing that I had a question about is "what are the RGB values for the default Eterm colors"? Here's what I figured out:

Name          Code  RGB Value        Name          Code  RGB Value
Black         30    000000           Dark Gray     1;30  333333
Red           31    cc0000           Light Red     1;31  ff0000
Green         32    00cc00           Light Green   1;32  00ff00
Blue          34    0000cc           Light Blue    1;34  0000ff
Cyan          36    00cccc           Light Cyan    1;36  00ffff
Purple        35    cc00cc           Light Purple  1;35  ff00ff
Brown         33    cccc00           Yellow        1;33  ffff00
Light Gray    37    faebd7           White         1;37  ffffff

The color names are from /usr/doc/HOWTO/Bash-Prompt-HOWTO.

I didn't understand at first why it was so difficult to find a list of THE ANSI colors (in RGB) somewhere on the 'net. Now I understand that there IS no THE ANSI colors (at least in RGB). The sixteen ANSI colors appear to be defined simply as "black", "blue", "green", "cyan", etc. and are not defined down at the RGB level at all. I base this conclusion on the fact that gnome-terminal, Eterm and a page I found on the 'net with the ANSI colors described (look in the HTML and you'll find the RGB values that the author chose) all three use different RGB values. The RGB values are pretty straightforward in all three cases except for light gray in the Eterm set and brown in the gnome-terminal set. These two colors use unusual RGB values, and I can't explain why. Anyway, here are the values for gnome-terminal:

Name          Code  RGB Value        Name          Code  RGB Value
Black         30    000000           Dark Gray     1;30  555555
Red           31    aa0000           Light Red     1;31  ff5555
Green         32    00aa00           Light Green   1;32  55ff55
Blue          34    0000aa           Light Blue    1;34  5555ff
Cyan          36    00aaaa           Light Cyan    1;36  55ffff
Purple        35    aa00aa           Light Purple  1;35  ff55ff
Brown         33    aa5500           Yellow        1;33  ffff55
Light Gray    37    aaaaaa           White         1;37  ffffff

And here are the values I found at http://knuckle.sandwich.net/ansi.html:

Name          Code  RGB Value        Name          Code  RGB Value
Black         30    000000           Dark Gray     1;30  444444
Red           31    aa0000           Light Red     1;31  ff4444
Green         32    00aa00           Light Green   1;32  44ff44
Blue          34    0000aa           Light Blue    1;34  4444ff
Cyan          36    00aaaa           Light Cyan    1;36  44ffff
Purple        35    aa00aa           Light Purple  1;35  ff44ff
Brown         33    aaaa00           Yellow        1;33  ffff44
Light Gray    37    aaaaaa           White         1;37  ffffff

Here's a shell script that's semi-useful.

echo -e "     \033[30mBlack\033[0m \033[1;30mDark Gray\033[0m"
echo -e "      \033[34mBlue\033[0m \033[1;34mBlue (Light)\033[0m"
echo -e "     \033[32mGreen\033[0m \033[1;32mGreen (Light)\033[0m"
echo -e "      \033[36mCyan\033[0m \033[1;36mCyan (Light)\033[0m"
echo -e "       \033[31mRed\033[0m \033[1;31mRed (Light)\033[0m"
echo -e "    \033[35mPurple\033[0m \033[1;35mPurple (Light)\033[0m"
echo -e "     \033[33mBrown\033[0m \033[1;33mYellow\033[0m"
echo -e "\033[37mLight Gray\033[0m \033[1;37mWhite\033[0m"

Here's a more sophisticated one I took from /usr/doc/HOWTO/Bash-Prompt-HOWTO.

  #!/bin/bash
  #
  #   This file echoes a bunch of colour codes to the terminal to demonstrate
  #   what's available.  Each line is one colour on black and gray
  #   backgrounds, with the code in the middle.  Verified to work on white,
  #   black, and green BGs (2 Dec 98).
  #
  echo "  On Light Gray:        On Black:"
  echo -e "\033[47m\033[1;37m  White        \033[0m\
   1;37m \
  \033[40m\033[1;37m  White        \033[0m"
  echo -e "\033[47m\033[37m  Light Gray   \033[0m\
     37m \
  \033[40m\033[37m  Light Gray   \033[0m"
  echo -e "\033[47m\033[1;30m  Gray         \033[0m\
   1;30m \
  \033[40m\033[1;30m  Gray         \033[0m"
  echo -e "\033[47m\033[30m  Black        \033[0m\
     30m \
  \033[40m\033[30m  Black        \033[0m"
  echo -e "\033[47m\033[31m  Red          \033[0m\
     31m \
  \033[40m\033[31m  Red          \033[0m"
  echo -e "\033[47m\033[1;31m  Light Red    \033[0m\
   1;31m \
  \033[40m\033[1;31m  Light Red    \033[0m"
  echo -e "\033[47m\033[32m  Green        \033[0m\
     32m \
  \033[40m\033[32m  Green        \033[0m"
  echo -e "\033[47m\033[1;32m  Light Green  \033[0m\
   1;32m \
  \033[40m\033[1;32m  Light Green  \033[0m"
  echo -e "\033[47m\033[33m  Brown        \033[0m\
     33m \
  \033[40m\033[33m  Brown        \033[0m"
  echo -e "\033[47m\033[1;33m  Yellow       \033[0m\
   1;33m \
  \033[40m\033[1;33m  Yellow       \033[0m"
  echo -e "\033[47m\033[34m  Blue         \033[0m\
     34m \
  \033[40m\033[34m  Blue         \033[0m"
  echo -e "\033[47m\033[1;34m  Light Blue   \033[0m\
   1;34m \
  \033[40m\033[1;34m  Light Blue   \033[0m"
  echo -e "\033[47m\033[35m  Purple       \033[0m\
     35m \
  \033[40m\033[35m  Purple       \033[0m"
  echo -e "\033[47m\033[1;35m  Pink         \033[0m\
   1;35m \
  \033[40m\033[1;35m  Pink         \033[0m"
  echo -e "\033[47m\033[36m  Cyan         \033[0m\
     36m \
  \033[40m\033[36m  Cyan         \033[0m"
  echo -e "\033[47m\033[1;36m  Light Cyan   \033[0m\
   1;36m \
  \033[40m\033[1;36m  Light Cyan   \033[0m"

Here's the table with the RGB values for the default Eterm colors again, expanded to include the internal number that Eterm uses to refer to each color.

              Eterm                                         Eterm
Name          Color #  Code  RGB Value        Name          Color #  Code  RGB Value
Black         0        30    000000           Dark Gray     8        1;30  333333
Red           1        31    cc0000           Light Red     9        1;31  ff0000
Green         2        32    00cc00           Light Green   10       1;32  00ff00
Brown         3        33    cccc00           Yellow        11       1;33  ffff00
Blue          4        34    0000cc           Light Blue    12       1;34  0000ff
Purple        5        35    cc00cc           Light Purple  13       1;35  ff00ff
Cyan          6        36    00cccc           Light Cyan    14       1;36  00ffff
Light Gray    7        37    faebd7           White         15       1;37  ffffff

So to swap "white" and "light green" and lighten up "light blue":

Eterm -f rgb:00/ff/00 --color10 rgb:ff/ff/ff --color12 rgb:99/99/ff -W -O --shade 60 --home-on-echo no --home-on-input

Why not --color10 rgb:ff/ff/ff --color12 rgb:99/99/ff --color15 rgb:00/ff/00? It doesn't work. By default, foreground-color and color15 are both "white", but they CAN be set differently, and "ls --color" uses the ANSI code for foreground-color, not for color15.

I said something earlier about doing something with my bash prompt. Well, I decided not to group that with the Eterm material. It really doesn't have anything to do with Eterm, although it WAS researching the colors for Eterm that led me to the Bash-Prompt-HOWTO. Anyway, go to http://home.earthlink.net/~edward_leah/linux to see what I did.


Copyright © 2000, Edward Livingston-Blade
Published in Issue 51 of Linux Gazette, March 2000

Talkbacks

[ Table of Contents ] [ Front Page ] [ Prev ] [ Linux Gazette FAQ ] [ Next ]