-
Notifications
You must be signed in to change notification settings - Fork 1
/
mandala-xbiff
83 lines (76 loc) · 3.35 KB
/
mandala-xbiff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Here is a start of a good XBiff defaults file. Cut everything
in between the === lines into the file and all will be well.
============================================
! This file belongs in /usr/lib/X11/app-defaults/XBiff
!
! This method of setting up xbiff assumes/requires that EVERY user of xbiff
! is using Maildirs. If that is not the case leave out the *checkCommand line
! and when running xbiff do it with this command line argument... "xbiff -xrm
! '*checkCommand:/usr/local/bin/checkmail'" and it will work with Maildirs
! only for the person invoking xbiff in this fashion. Or you could do
! something like add an alias in the /etc/bashrc file like alias
! xbiff-Maildir="xbiff -xrm '*checkCommand:/usr/local/bin/checkmail'"
! and then tell your users about the alias.
!
! I do not know if the * are required in front of the commands but it works
! correctly that way so I'll leave them there.
! Make sure to put the checkmail command in /usr/local/bin and make it 755
! permissions and chown it to root:root or this is going to break
! This tells XBiff to use /usr/local/bin/checkmail to tell if any new mail
! has been delivered to the Mairdir in question. Remember THIS IS ONLY SAFE
! TO DO ON A SYSTEM THAT ALL xbiff users have Maildirs.
*checkCommand:/usr/local/bin/checkmail
! On a low load machine (few users active at one time check mail often, if
! lots of users or higher load system slow it down (this is in seconds)
*update:1
! I like to hear the mail arrive, volume defaults to 33% my machine is
! better at 50%
*volume:50
! width and height set the size of the window. On my machine this makes a
! fairly good square without squashing the mailbox. Adjust this as needed
! for your viewing pleasure
*width:48
*height:88
============================================
Here is the checkmail program cleaned up a little with some comments added,
again cut everything between the ==== lines into the file and all will be
well.
============================================
#!/bin/sh
#
# Program: checkmail
# Program by: Timothy L. Mayo
# Email: tmayo@mayod.nb.net
# WWW: http://mayod.nb.net/
#
# Provided with the permission of the author for personal use.
# This software provided as. It is used at your own risk....
#
# Comments and very slight modifications by: David Mandala
#
# The purpose of this script is to allow xbiff to detect if new mail has
# arrived in a Maildir, it could be a bit more general, right now it expects
# that the Maildir will exist in $HOME/Maildir. If for some reason that is not
# the case on your machine you will need to fixup the script a bit. This
# script needs to be chowned by root:root with permissions of 755 if it is
# going to be used machine wide. It should be placed in /usr/local/bin.
# If you have the older version of ls that does not understand --color=no use
# this line.
# ls $HOME/Maildir/new > $HOME/.curmail
# This line works with the newer versions of ls that do color automatically
# and understand the command --color=no
ls --color=no $HOME/Maildir/new > $HOME/.curmail
if [ "`wc -l $HOME/.curmail | colrm 8`" != " 0" ]; then
if [ -f $HOME/.prevmail ]; then
if [ "`diff --brief $HOME/.curmail $HOME/.prevmail`" ]; then
mv $HOME/.curmail $HOME/.prevmail
exit 0
fi
exit 1
fi
mv $HOME/.curmail $HOME/.prevmail
exit 0
else
exit 2
fi
============================================