|
|
A script to cycle Terminal color/transparency settings
Make it shorter than mine and you win!
---
ZEORGE MADE IT BEST :) HEHE
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.
#!/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");
ZEORGE MADE IT BEST :) HEHE
use this script from your .tcshrc or .bashrc |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.10 seconds |
|