Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'ZEORGE MADE IT BEST :) HEHE' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
ZEORGE MADE IT BEST :) HEHE
Authored by: zeorge on Aug 27, '04 02:27:10PM

use this script from your .tcshrc or .bashrc
it does not use apple script so its 1000 times faster.
you can setup a color list - random colors are chosen.

save it als ~/.setcolor.pl for example,
and dont forget to chmod +x ~/.setcolor.pl.

<code>
#!/usr/bin/perl
# zeorge 08-2004 - terminal BG color changer - works with panther 10.3.5

# Colors to choose from, in R G B
@color_table = ( "0.200 0.000 0.000","0.000 0.200 0.000","0.000 0.000 0.200" );
$opaqueness = "0.95";

#defaults read com.apple.terminal TextColors
@text_colors = split " ",`defaults read com.apple.terminal TextColors`;

# Randomly select a Color
$index = int( rand( scalar( @color_table ) ) );
@colors = split " ", @color_table[$index];

# set selected color in TextColors array
# pos 1 and 4 of TextColors = background color

$pos = 1 ;
@text_colors[$pos*3] = @colors[0];
@text_colors[$pos*3+1] = @colors[1];
@text_colors[$pos*3+2] = @colors[2];
$pos = 4 ;
@text_colors[$pos*3] = @colors[0];
@text_colors[$pos*3+1] = @colors[1];
@text_colors[$pos*3+2] = @colors[2];

# ( pos 0 and 4 of TextColors = text color
# pos 2 and 3 of TextColors = text bold color
# pos 6 of TextColors = selection color
# pos 7 of TextColors = cursor color )

# Set the new background color via the 'defaults' command
system("defaults","write","com.apple.terminal","TextColors","@text_colors");
system("defaults","write","com.apple.terminal","TerminalOpaqueness","$opaqueness");
</code>



[ Reply to This | # ]