Re: random aterm tinting

Bartosz Wucke (sharp@solutions.net.pl)
Wed, 10 Apr 2002 23:15:11 +0200




rishuken@icqmail.com wrote:
> How do you get aterm to cycle through using different tints (red, blue, yellow)
>etc with each instance of aterm?  In Eterm you can do it with %random(red, blue, yellow).  

AFAIK you can't.

That's not a bad idea, but it would be unnecessary binary bloat.
I suggest using a starter script instead, like this:
(locking code shamelessly ripped from perlfaq5(3pm)

#!/usr/bin/perl -w

use Fcntl ':flock';

@colors=qw(red green blue magenta yellow cyan);

$TINTFILE="${ENV{HOME}}/GNUstep/Library/AfterStep/.atermtint";

   sysopen(FH,"$TINTFILE",O_RDWR|O_CREAT)
		#try using "2" instead of O_RDWR|O_CREAT if fails.
                                  or die "can't open $TINTFILE: $!";
   flock(FH, LOCK_EX)             or die "can't flock $TINTFILE: $!";
   $num = <FH> || 0;

   seek(FH, 0, 0)                 or die "can't rewind $TINTFILE: $!";
   truncate(FH,0)                or die "can't truncate $TINTFILE: $!";
   $num++;
   if($num>5 or $num<0){$num=0};
   (print FH "$num\n")            or die "can't write $TINTFILE: $!";
   flock(FH, LOCK_UN)             or die "can't flock $TINTFILE: $!";
   close FH                       or die "can't close $TINTFILE: $!";

$color=$colors[$num];

#Change the params, font etc to your liking.

exec("aterm -tr -trsb -fg $color -tint $color -sr -st -sh 60 -fn 
\"-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-2\"
  -fade 80 &") or die "Can't exec aterm: $!";

_______________________________________________
The AfterStep Window Manager for X User's Mailing List
http://mail.afterstep.org/mailman/listinfo/as-users