[comp.windows.x] Enhance xbiff and oclock on expo

wagner@leech.siemens.COM (Michael Wagner) (02/22/91)

Well, I finally got around to wrapping up the loose ends and I've
uploaded version two of the enhanced xbiff and oclock to expo. They now
have proper names, xbiff++ and oclock++, respectively (how original). In
case you've just tuned in, the enhancements include an interface to the
audio device on SPARCstations. The major fix in this release is support
for the audio interface of SunOS 4.1. Thanks to Greg Earle for the mods.
Also added is support in xbiff++ for changing the bitmap based on the
sender (or subject or recipient or ...) of the new mail.  Attached below
is the README for xbiff++. Have fun.

Michael Wagner
Siemens Corporate Research, Inc.
Princeton, NJ 08540
wagner@cadillac.siemens.com

-------------------README------------------------------------
This is an enhanced version of the X11 R4 xbiff. The two major
enhancements are the support for playing sounds on the Sun
SPARCstation, and the ability to display a different "mailFull"
bitmap depending on who the mail is from or to.  A minor
enhancement is how it checks for new mail.  The old version just
checked to see if the size had changed. This version actually
scans the mail file and determines which messages have not been
read (by looking for "Status:" lines in the headers.)

Sound support is provided in two flavors. First you can specify a
list of bindings of sounds to patterns. The patterns are matched
against lines in the message headers and if a match is made, the
corresponding sound is played (given that the message is new).
Second, a default sound can be given which is played for each
message that doesn't match a sound binding pattern. In the
simplest case, the default sound can be used to replace the beep
sound played by the old version of xbiff. 

Bitmap bindings work the same way; bitmap bindings always work, but
sounds only work on Sparcstations.

The format of sound and face bindings is given in the man page.
Simply put, it is a string made up of comma separated substrings.
Each substring specifies a binding. A binding is a pattern and
sound pair, separated by a vertical bar ('|'). Here's an example
resource specification illustrating the binding format.

! xbiff++
!
xbiff++.Geometry:		48x48+1032+6
xbiff++*showTitle:	off
xbiff++*shapeWindow:	on
xbiff++*fullPixmap:	/home/kong/wagner/X/bitmaps/mailbox_full.xbm
xbiff++*fullPixmapMask:	/home/kong/wagner/X/bitmaps/mailbox_full_msk.xbm
xbiff++*emptyPixmap:	/home/kong/wagner/X/bitmaps/mailbox_empty.xbm
xbiff++*emptyPixmapMask: /home/kong/wagner/X/bitmaps/mailbox_empty_msk.xbm
xbiff++*sound:		/home/kong/wagner/sound/new/OhmyGod.au

xbiff++*caseSensitive:	false
xbiff++*soundSearchPath:/home/kong/wagner/sound,/usr/demo/SOUND/sounds
xbiff++*soundBindings:\
From:.*wagner|Musical/Flourish6.au,\
From:.*jcc|Beeps/jazz_piano_beep.au,\
From:.*root|Misc/EvilLaugh.au,\
From:.*Mailer-Daemon|Misc/Moron.au,\
Subject:.*Homebrew.*|SFX/Slurp.au

xbiff++*faceSearchPath:/home/kong/wagner/faces
xbiff++*faceBindings:\
From:.*root|root.xbm,\
From:.*uucp|uucp.xbm,\
From:.*daemon|mailer-daemon.xbm,\
From:.*wagner|wagner.xbm,\
From:.*jcc|jcc.xbm,\
From:.*jamie.*zawinski|faces/jwz.xbm

Note that the "xbiff++*soundBindings" and "xbiff++*faceBindings"
resources use escaped newlines for readability.  Also, xbiff++ uses
Henry Spencer's regular expression package for the patterns. See
the included man page for a description of the regular expression
syntax supported.

The order of the fields in the sound and bitmap bindings matters, 
while the order of the fields in the incoming mail message does not.
Therefore, if, when a message matches (for example) a "Subject"
template as well as a "From" template, the one which you wish to
be displayed/played should appear earlier in your bindings list.

The Imakefile should compile right out of the box as long as
you're not running SunOS 4.0.3 on a SPARCstation. If you are, you
need to change the values given to SYS_LIBRARIES and DEFINES
from the default. See the Imakefile for details. Also included
are two sounds which make good defaults for a new mail sound and
a no mail sound. Also, the name of the executable has been
changed from the R4 xbiff and also the previous public release of
audio-xbiff. This requires changes to existing resource descriptions.

--
Mike Wagner			Jamie Zawinski
wagner@cadillac.siemens.com	jwz@lucid.com
Jan. 17, 1991			Dec 10, 1990