#! /bin/sh

# Automatic sfirah counter!  Don't forget to count...

# Based on David Sherman's orignal program on Usenet's
# Soc.culture.jewish newsgroup.

# I modified it so that your sfirah marker comes through
# zephyr, rather than in a mail file.  (Instead of having
# to incorporate your mail to find out which day to count,
# you get a zephyr notice of instance personal, class
# message, reminding you to count.

# To use, modify the WHO variable (below) to your username.
# (Or, if you're devilish, to one or more other people who
# should know that it's Omer season again.)
#    You should also place a line saying "sefirah" (or
# "/mit/reuven/util/sfirah", after attaching my
# directory) to your .login.mine file.  That will run the
# sefirah program each and every time you log in.

# Have fun, and Happy Omer!  (?)

# Reuven M. Lerner
# reuven@athena.mit.edu

# Modified to automatically figure out the WHO variable.
# 17 Apr 89
#  Andrew Marc Greene
#  amgreene@athena.mit.edu
#  SIPB Member and
#  Project Athena Watchmaker

WHO=`whoami`

sfirah=0
set `date`
case $6 in 1989)
	   case $2 in
	   Apr)
	   		 case $3 in [23]?)
	   		 	    sfirah=`expr $3 - 19`
	   		 	    ;;
	   		 esac
	   		 ;;
	   May)
	   		 sfirah=`expr $3 + 11`
	   		 ;;
	   June)
	   		 case $3 in [1-7])
	   		 	    sfirah=`expr $3 + 42`
	   		 	    ;;
	   		 esac
	   		 ;;
	   esac
esac

case $sfirah in 0)
	   zwrite $WHO -m "no sfirah today"
	   ;;
	   *)
	   zwrite $WHO -m "Count day $sfirah of the Omer tonight"
	   ;;
esac

# Note that there is a better version of this program
# (I think), which sends a message of instance sfirah,
# class message to you.  Using this one is a bit more
# complicated (if you don't know zephyr), but lets you
# be more creative.

# To understand what I mean, look at my .Xresources and
# .zephyr.desc files.
