I got tired of opening and email client everytime i got new mail just to have it be SPAM. So i wrote up alittle something that will display the subject of all your new and/or old mail in a your mail box. The only requirement is that your mail box be in maildir format ( new cur tmp).
Heres what you have to add to your .fvwm2rc file. Edit the path to the mail_menu.sh file. The default location is /home/$USER/.fvwm/scripts/
AddToMenu FvwmNewMailMenu
+ DynamicPopupAction Function FvwmNewMailMenu
DestroyFunc FvwmNewMailMenu
AddToFunc FvwmNewMailMenu
+ I DestroyMenu recreate FvwmNewMailMenu
+ I AddToMenu FvwmNewMailMenu
+ I PipeRead '/home/$USER/.fvwm/scripts/mail_menu.sh new'
AddToMenu FvwmOldMailMenu
+ DynamicPopupAction Function FvwmOldMailMenu
DestroyFunc FvwmOldMailMenu
AddToFunc FvwmOldMailMenu
+ I DestroyMenu recreate FvwmOldMailMenu
+ I AddToMenu FvwmOldMailMenu
+ I PipeRead '/home/$USER/.fvwm/scripts/mail_menu.sh old'
DestroyMenu MenuFvwmMail
AddToMenu MenuFvwmMail
+ "New Mails" Popup FvwmNewMailMenu
+ "Old Mails" Popup FvwmOldMailMenu
Then add this to your root menu
+ "Check Mails" Popup MenuFvwmMail
And heres the bash script. You need to edit the mail_path so that it points to your maildir. Default is /home/$USER/Mail.
#!/bin/bash
mail_path=/home/$USER/Mail
case $1 in
new)
for new in `ls $mail_path/new/*`
do
echo "+ \"`cat $new|grep Subject:| fold -w 35 | head -n 1`\" Nop"
done ;;
old) for cur in `ls $mail_path/cur/*`
do
echo "+ \"`cat $cur|grep Subject:| fold -w 35 | head -n 1`\" Nop"
done ;;
esac
The only problem i have with it is i havent been able figure out how to shorten the subject down so its only a few words long. Eventually i plan on rewriting it in perl and haveing the option to read either mbox or maildir and make it an fvwm module. That will be my first major perl script. Hope you all enjoy it.
VoiDeR