terminal.sexy – make your teminal sexy
terminal.sexy is a nice webpage that allows you to select the colors for your terminal and then you can export it in various formats.
Main site : http://terminal.sexy
and for the source code: Github URL
terminal.sexy is a nice webpage that allows you to select the colors for your terminal and then you can export it in various formats.
Main site : http://terminal.sexy
and for the source code: Github URL
Today we will look at the variable GREP_COLORS. This variable determines the colour that is used with the grep command. You can look at the man page of the grep command to see what the various options mean. Here is the excerpt from the man command:
GREP_COLORS
Specifies the colors and other attributes used to highlight various parts of the
output. Its value is a colon-separated list of capabilities that defaults to
ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36 with the rv and ne boolean
capabilities omitted (i.e., false). Supported capabilities are as follows.
sl= SGR <a class="zem_slink" title="Substring" href="http://en.wikipedia.org/wiki/Substring" rel="wikipedia">substring</a> for whole selected lines (i.e., matching lines when the -v
command-line option is omitted, or non-matching lines when -v is specified).
If however the boolean rv capability and the -v command-line option are both
specified, it applies to context matching lines instead. The <a class="zem_slink" title="Default (finance)" href="http://en.wikipedia.org/wiki/Default_%28finance%29" rel="wikipedia">default</a> is
empty (i.e., the terminal's default color pair).
cx= SGR substring for whole context lines (i.e., non-matching lines when the -v
command-line option is omitted, or matching lines when -v is specified). If
however the boolean rv capability and the -v command-line option are both
specified, it applies to selected non-matching lines instead. The default
is empty (i.e., the terminal's default color pair).
rv <a class="zem_slink" title="Boolean data type" href="http://en.wikipedia.org/wiki/Boolean_data_type" rel="wikipedia">Boolean value</a> that reverses (swaps) the meanings of the sl= and cx=
capabilities when the -v command-line option is specified. The default is
false (i.e., the capability is omitted).
mt=01;31
SGR substring for matching <a class="zem_slink" title="Empty set" href="http://en.wikipedia.org/wiki/Empty_set" rel="wikipedia">non-empty</a> text in any matching line (i.e., a
selected line when the -v command-line option is omitted, or a context line
when -v is specified). Setting this is equivalent to setting both ms= and
mc= at once to the same value. The default is a bold red text foreground
over the current line background.
ms=01;31
SGR substring for matching non-empty text in a selected line. (This is only
used when the -v command-line option is omitted.) The effect of the sl= (or
cx= if rv) capability remains active when this kicks in. The default is a
bold red text foreground over the current line background.
mc=01;31
SGR substring for matching non-empty text in a context line. (This is only
used when the -v command-line option is specified.) The effect of the cx=
(or sl= if rv) capability remains active when this kicks in. The default is
a bold red text foreground over the current line background.
fn=35 SGR substring for file names prefixing any content line. The default is a
magenta text foreground over the terminal's default background.
ln=32 SGR substring for <a class="zem_slink" title="Line number" href="http://en.wikipedia.org/wiki/Line_number" rel="wikipedia">line numbers</a> prefixing any content line. The default is a
green text foreground over the terminal's default background.
bn=32 SGR substring for byte offsets prefixing any content line. The default is a
green text foreground over the terminal's default background.
se=36 SGR substring for separators that are inserted between selected line fields
(:), between context line fields, (-), and between groups of adjacent lines
when nonzero context is specified (--). The default is a cyan text
foreground over the terminal's default background.
ne Boolean value that prevents clearing to the <a class="zem_slink" title="Newline" href="http://en.wikipedia.org/wiki/Newline" rel="wikipedia">end of line</a> using Erase in Line
(EL) to Right (\33[K) each time a colorized item ends. This is needed on
terminals on which EL is not supported. It is otherwise useful on terminals
for which the back_color_erase (bce) boolean terminfo capability does not
apply, when the chosen highlight colors do not affect the background, or
when EL is too slow or causes too much flicker. The default is false (i.e.,
the capability is omitted).
Continue reading

I was looking for a way to set the terminal colors for gnome. There is a GUI way to change the same by going to the Preferences->Colors. And then you can change the colors that you see in the color pallete in the bottom of the dialog box.
But I was looking at doing it faster and better, and finally I found this page.
Continue reading
I have been trying to understand the color codes for bash for a pretty long time, but somehow never got time to understand this clearly. So this time around when I was writing a script to analyze some logs. I thought I will give it a go and finally understood some part of this.
So, first we will start with this script. This is taken from here.
Continue readingIf you are looking for testing the colors on how they would look like in the xterm before you set the color then here is a small script for you.
|
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
This can be used in various ways but I will leave the choice to you. One option that I should probably still tell is :
Continue readingmy favourite <a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/06/gtkrc-2.0-gnome-color-chooser">gtkrc-2 file.
Snapshot of how it looks.
<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/06/desktop.jpg"><img class="size-medium wp-image-796" title="desktop" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/06/desktop-300x187.jpg" alt="desktop" width="300" height="187" /><div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/zemified_e1.png" alt="Enhanced by Zemanta" /><span class="zem-script more-related pretty-attribution">
There are two ways to do it, one is with tput command. We will see that some other time, today we will consider the escape sequence way.
First we need to understand the colors as understood by bash. Some time back a fried of mine gave me this little script to find the colors. You can download it <a href="http://blog.amit-agarwal.co.in/2009/03/bash_colors" target="_blank">Script bash colors. Here is the script
#!/bin/bash
T=’amit agarwal’ # The test text
Continue reading