#!/usr/ug/bin/perl5 # vim:fo=croql:cin:com=\:# # # the special box format (Heil) # now with html-esque tags for increased irritation use strict; use POSIX qw(strftime); use vars qw($UON $UOFF $BLON $BLOFF $BON $BOFF $CEOL $STOMP $BEEP); my $COLUMNS; if (defined($ENV{'COLUMNS'})) { $COLUMNS= $ENV{'COLUMNS'}; } else { $COLUMNS= 80; } exit if $ENV{'GALE_CATEGORY'} =~ m-/ping$|/ping:-; if (-t 1) { $BON= `tput md 2>/dev/null`; if ($? == 0) { $BOFF= `tput me`; $UON= `tput us`; $UOFF= $BOFF; $BLON= `tput so`; $BLOFF= $BOFF; } else { $BON= `tput bold`; $BOFF= `tput sgr0`; $UON= `tput smul`; $UOFF= `tput rmul`; $BLON= `tput blink`; $BLOFF= $BOFF; } $CEOL= `tput el`; $STOMP= "\r"; $BEEP= "\a"; } if ($ENV{'GALE_CATEGORY'} =~ m-/receipt$|/receipt:-) { &printReceipt; } else { &printMessage; } sub printReceipt { #*