Re: [Evolution] New mail indicator on Gnome2.0?



Attached is a simple perl script i wrote to monitor the inbox and use
xbiff to let me know when a new mail has arrived:

In my setup i have subfolders of inbox (where my mail gets filtered to
depending on the pop account its coming from and other filter criteria)
- i want to be informed if any of those "inboxes" grow. 

I also have "sub sub folders" of inbox - i don't want to get informed
about these, as that is where i filter my "non-critical" (list) mail...
and so the script is designed to ignore these as it does a 
/subfolders/*/mbox and not a subfolders/*/*/mbox as well... although you
can add that in quite simply if you like. 


The setup is described below
=============================


.xsession file (partial)
---------------
xbiff -geometry  88x90+102+0 &
ctwm

.Xdefaults file (partial)
--------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! Xbiff 

XBiff*checkCommand:     /home/simran/bin/xbiff-checkmail.pl

#ifdef COLOR

XBiff*update:           30
XBiff*volume:           0
XBiff*foreground:       dodger blue
XBiff*background:       black
XBiff*geometry:         125x125+133+0

#else

XBiff*update:           60
XBiff*volume:           95
XBiff*geometry:         125x125+133+0

#endif

The script
----------

#!/usr/local/bin/perl

##################################################################################################################
#
# Source  : $Source: /home/simran/cvs/bin/xbiff-checkmail.pl,v $
# Revision: $Revision: 1.1 $
# Date    : $Date: 2002/02/01 05:05:47 $
# Author  : $Author: simran $
#
# Description:  used by xbiff to determine if there is new mail... 
#
##################################################################################################################

use strict;

my $inbox_dir = "/home/simran/evolution/local/Inbox";
my $size      = 0;
my $orig_size = &readSize();

foreach my $file (<$inbox_dir/mbox>, <$inbox_dir/subfolders/*/mbox>) {
  $size += -s $file;
}
  
&writeOut($size);

if ($size > $orig_size) {
  exit(0);
}
elsif ($size < $orig_size) {
  exit(2);
}
else {
  exit(1);
}

sub writeOut {
  my $size = shift;
  open(OUT, "> /tmp/xbiff-mail.size") || die "Could not write to file: $!";
  print OUT $size;
  close(OUT);
}

sub readSize {
  open(IN, "/tmp/xbiff-mail.size") || return 0;
  my $size = <IN>;
  chomp($size);
  close(IN);
  return $size || 0;
}


============================================================================

ps: If you want a reasonable 1991 looking setup using the brilliant
window manager "ctwm" - let me know... my setup hasn't changed much
since then, except for using evolution of course :-) 










On Tue, 2002-10-08 at 19:06, Alexandre Aractingi wrote:
Hi all,
What are the most recommended / used new mail indicators for Evo under
Gnome 2 (mdk 9.0)? I'm looking for one that would be able to tell me
that a new mail arrived, either in my POP3 accounts or in my IMAP
ones...
Thanks everyone!
Alex




_______________________________________________
evolution maillist  -  evolution ximian com
http://lists.ximian.com/mailman/listinfo/evolution










[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]