From: Christopher Davis <ckd@loiosh.kei.com>
Subject: Re: Gnus+procmail and display-time
Date: 27 May 1997 16:12:44 -0400 [thread overview]
Message-ID: <w4yb90n077.fsf@loiosh.kei.com> (raw)
In-Reply-To: merlyn@stonehenge.com's message of 22 May 97 23:05:48 GMT
[-- Attachment #1: Type: text/plain, Size: 1338 bytes --]
RS> == Randal Schwartz <merlyn@stonehenge.com>
RS> I file all my "direct to me, not from a mailing list" email into
RS> a single folder (my "inbox", because it was rooted in my MH usage).
RS> For me, this is:
RS> /home/merlyn/.incoming/inbox.spool
[...]
RS> Other filed mail doesn't trigger, but that's stuff I don't need
RS> immediate notify about anyway.
I use a similar setup, except that I have all the procmail spools named
the same as the nnml groups they get sucked into (no suffix). I manage
them with some shell aliases (tcsh) and a pair of perl scripts.
The aliases:
if ($?prompt) then
set maildir="$HOME/Mail/spool"
set mail="$maildir/inbox"
alias m "subj -f $mail"
alias mb "subj -f $maildir/\!:1"
alias mt "subj -f $mail | tail"
alias mtb "subj -f $maildir/\!:1 | tail"
alias mnt "subj -f $mail | cat -n | tail"
alias mntb "subj -f $maildir/\!:1 | cat -n | tail"
alias mn "subj -f $mail | cat -n"
alias mnb "subj -f $maildir/\!:1 | cat -n"
alias mm less -+E +G -e $mail
alias mmb less -+E +G -e $maildir/\!:1
endif
The perl scripts are attached. One's for X displays (uses Tk); the other
is for command lines. They're fairly self explanatory (especially the
second one).
The Tk one has a few leftovers from earlier versions that used cute little
icons instead of colors; just ignore them... :)
[-- Attachment #2: tkckm --]
[-- Type: application/octet-stream, Size: 1591 bytes --]
#!/usr/local/bin/perl
#use strict;
use Tk;
########
### configuration section
########
my $spooldir = "$ENV{'HOME'}/Mail/spool";
my $delay = 30 * 1000; # measured in msec
#my $picdir = "$ENV{'HOME'}/lib/tkckm/";
#my $emptypic = "$picdir/empty.xpm";
#my $readpic = "$picdir/read.xpm";
#my $newpic = "$picdir/new.xpm";
#my $font = "-*-lucida-medium-r-*-*-10-*-*-*-*-*-*-*";
$color{'read'} = "black";
$color{'empty'} = "gray80";
$color{'new'} = "red";
########
### end of configuration section
########
chdir($spooldir) || die "can't chdir";
sub scan_spools {
foreach $spoolfile (@spoolfiles) {
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = stat($spoolfile);
if ($size == 0) {
$status{$spoolfile} = 'empty';
} elsif ($atime < $mtime) {
$status{$spoolfile} = 'new';
} else {
$status{$spoolfile} = 'read';
}
}
}
sub update_widgets {
foreach $mbox (keys %status) {
$namelabels{$mbox}->configure(-foreground => $color{$status{$mbox}});
}
}
sub scan_and_update {
&scan_spools;
&update_widgets;
after($delay,\&scan_and_update);
}
@spoolfiles = <*>; # XXX should be able to dynamically add files
&scan_spools;
$main = MainWindow->new();
$main->Pixmap('empty',-file => $emptypic);
$main->Pixmap('read',-file => $readpic);
$main->Pixmap('new',-file => $newpic);
foreach $mbox (sort keys %status) {
$namelabels{$mbox} = $main->Label(-text => $mbox,
-anchor => 'e',
);
$namelabels{$mbox}->pack(-fill => 'x',
-side => 'top');
}
&scan_and_update;
MainLoop;
[-- Attachment #3: ckm --]
[-- Type: application/octet-stream, Size: 312 bytes --]
#!/usr/bin/perl
$spooldir = "$ENV{'HOME'}/Mail/spool";
chdir($spooldir) || die "can't chdir";
foreach (<*>) {
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks) = stat($_);
next if ($size == 0);
print (($atime < $mtime)?" ** ":" ");
print $_,"\n";
}
next prev parent reply other threads:[~1997-05-27 20:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-05-22 22:19 Nelson Jose dos Santos Ferreira
1997-05-22 22:50 ` Mark Boyns
1997-05-22 23:05 ` Randal Schwartz
1997-05-27 20:12 ` Christopher Davis [this message]
1997-08-20 17:02 ` Jason R Mastaler
1997-08-20 18:41 ` Chris D. Halverson
1997-08-20 19:49 ` Jason R Mastaler
1997-08-21 12:26 ` Jens Lautenbacher
1997-08-21 13:35 ` Jason R Mastaler
1997-08-21 17:52 ` Leonard Blanks
1997-08-22 2:16 ` Jason R Mastaler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=w4yb90n077.fsf@loiosh.kei.com \
--to=ckd@loiosh.kei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).