old-www/LDP/LG/issue51/livingston-blade.html

256 lines
16 KiB
HTML

<!--startcut ==============================================-->
<!-- *** BEGIN HTML header *** -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML><HEAD>
<title>Tweaking Eterm LG #51</title>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
ALINK="#FF0000">
<!-- *** END HTML header *** -->
<!-- *** BEGIN navbar *** -->
<A HREF="index.html"><IMG ALT="[ Table of Contents ]"
SRC="../gx/indexnew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom ></A>
<A HREF="../index.html"><IMG ALT="[ Front Page ]"
SRC="../gx/homenew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
<A HREF="kijewski.html"><IMG ALT="[ Prev ]" SRC="../gx/back2.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom></A>
<A HREF="../faq/index.html"><IMG ALT="[ Linux Gazette FAQ ]"
SRC="./../gx/dennis/faq.gif"WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
<A HREF="mauerer.html"><IMG ALT="[ Next ]" SRC="../gx/fwd.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom ></A>
<!-- *** END navbar *** -->
<!--endcut ============================================================-->
<H4>
"Linux Gazette...<I>making Linux just a little more fun!</I>"
</H4>
<P> <HR> <P>
<!--===================================================================-->
<center>
<H1><font color="maroon">Tweaking Eterm</font></H1>
<H4>By <a href="mailto:edward_leah@earthlink.net">Edward Livingston-Blade</a></H4>
</center>
<P> <HR> <P>
<!-- END header -->
Try this string with <A HREF="http://eterm.sourceforge.net">Eterm</A>:
<P>
<I>Eterm -W -O --shade 60 --home-on-echo no --home-on-input</I>
<P>
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.
<P>
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.
<P>
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>(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> 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 <U>appear</U> 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.
<P>
<B>correction:</B> 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 <A HREF="MAILTO:edward_leah@earthlink.net">let me know</A>.
<P>
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:
<P>
<PRE>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</PRE>
<P>
The color names are from /usr/doc/HOWTO/Bash-Prompt-HOWTO.
<P>
I didn't understand at first why it was so difficult to find a list of <B>THE</B> ANSI colors (in RGB) somewhere on the 'net. Now I understand that there IS no <B>THE</B> 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 <A HREF="http://knuckle.sandwich.net/ansi.html">page</A> 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:
<P>
<PRE>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</PRE>
<P>
And here are the values I found at <A HREF="http://knuckle.sandwich.net/ansi.html">http://knuckle.sandwich.net/ansi.html</A>:
<P>
<PRE>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</PRE>
<P>
<A HREF="misc/leah/color.sh.txt">Here's</A> a shell script that's semi-useful.
<P>
<PRE>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"</PRE>
<P>
<A HREF="misc/leah/color2.sh.txt">Here's</A> a more sophisticated one I took from /usr/doc/HOWTO/Bash-Prompt-HOWTO.
<P>
<PRE> #!/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"</PRE>
<P>
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.
<P>
<PRE> 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</PRE>
<P>
So to swap "white" and "light green" and lighten up "light blue":
<P>
<I>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</I>
<P>
Why not <I>--color10 rgb:ff/ff/ff --color12 rgb:99/99/ff --color15 rgb:00/ff/00</I>? 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.
<P>
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 <A HREF="http://home.earthlink.net/~edward_leah/linux">http://home.earthlink.net/~edward_leah/linux</A> to see what I did.
<!-- *** BEGIN copyright *** -->
<P> <hr> <!-- P -->
<H5 ALIGN=center>
Copyright &copy; 2000, Edward Livingston-Blade<BR>
Published in Issue 51 of <i>Linux Gazette</i>, March 2000</H5>
<!-- *** END copyright *** -->
<!--startcut ==========================================================-->
<!-- P --> <HR> <!-- P -->
<A HREF="http://www.linuxgazette.com/cgi-bin/talkback/all.py?site=LG&article=http://www.linuxgazette.com/issue51/livingston-blade.html">
<FONT SIZE="+2">Talkbacks</FONT></A>
<P>
<!-- *** BEGIN navbar *** -->
<A HREF="index.html"><IMG ALT="[ Table of Contents ]"
SRC="../gx/indexnew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom ></A>
<A HREF="../index.html"><IMG ALT="[ Front Page ]"
SRC="../gx/homenew.gif" WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
<A HREF="kijewski.html"><IMG ALT="[ Prev ]" SRC="../gx/back2.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom></A>
<A HREF="../faq/index.html"><IMG ALT="[ Linux Gazette FAQ ]"
SRC="./../gx/dennis/faq.gif"WIDTH=163 HEIGHT=60 ALIGN=bottom></A>
<A HREF="mauerer.html"><IMG ALT="[ Next ]" SRC="../gx/fwd.gif" WIDTH=41 HEIGHT=60 ALIGN=bottom ></A>
<!-- *** END navbar *** -->
</BODY></HTML>
<!--endcut ============================================================-->