\documentstyle[11pt,indentfirst]{report}
\addtolength{\oddsidemargin}{-.875in}
\addtolength{\evensidemargin}{-.875in}
\addtolength{\textwidth}{1.75in}
\setlength{\topmargin}{-.75in}
\setlength{\textheight}{8.75in}
\title{\begin{center}
\hspace*{1mm}\special{psfile=funky-owl.PS hoffset=-100}\hspace*{1mm}
\vspace{2cm}
\end{center}
\bf{Inessential Zephyr}}

\author{The Student Information Processing Board\\\\Abbe Cohen}
\date{August 23, 1993}

\def\thesection {\arabic{section}}
\def\thesubsection {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}

\begin{document}

\maketitle
\section{Introduction: About Zephyr}

Zephyr is a sytem that allows you to send and receive real-time
messages over Athena. Zephyr messages, or Zephyrgrams, appear as
windows on your Athena terminal display\footnote{You can also use
Zephyr in text on dialup.  See section 6.6 for more information}.  You
can only receive Zephyrgrams when you are logged in, and you can only
send them to other users who are logged in.  The command to send a
Zephyrgram is

\smallskip
{\tt zwrite} {\em username}

\noindent When you receive a Zephyrgram, you can get rid of it after you have
read it by clicking on it with any mouse button.

\section{Who's out there?}

To look for a user, you can use the command

\smallskip
 {\tt zlocate} {\em username}

\noindent which will either give you the name of the machine the user is logged
in on, or tell you that the user is {\tt Hidden or not logged-in}.
The second message indicates that the user is either not logged in, or
is not subscribing to Zephyrgrams, or does not want to be
zlocated\footnote{See Section 3 for information on how to avoid being
zlocated.}.

If you want to check whether a whole list of people are logged in, you
can use the {\tt znol} command.  First, you need to create a file
called {\tt .anyone} in your home directory.  This file should contain
a list of the usernames of all the people you want to look for, with
one username on each line.  Then, you can use the command

\smallskip
{\tt znol}

\noindent at your {\tt athena\%} prompt.  You will see a list of all the people
in your {\tt .anyone} file who are logged in.

The {\tt znol} command will also allow you to get Zephyrgrams
announcing when people in your {\tt .anyone} file log in and log out,
if they announce this information\footnote{See section 3
for information about login and logout Zephyrgrams.}. If you want to
only get a list of people logged in, without receiving login and
logout Zephyrgrams, you can use {\tt znol -l} instead.  Similarly, you
can use {\tt znol -q} to only receive login and logout Zephyrgrams.
Another useful option to {\tt znol} is

\smallskip{\tt znol -u} {\em username},

\noindent which allows you to just check one username and get Zephyr messages
when that person logs in and out.  This differs from just zlocating
that person because you will get login and logout Zephyrgrams.  It can
be done in addition to running {\tt znol} normally, so you can
basically add individual users to the list of people you want to check
on without adding them to your {\tt .anyone} file.

You can use the {\tt -f} option to use a file other than {\tt .anyone}
as the list of people.  For instance, you might list the usernames of
members of a club in a file called {\tt .anyone.club}, and check if
any of them are logged in with \verb+ znol -f ~/.anyone.club+.

\section{How To Expose Yourself}

Your exposure level on Zephyr determines who can zlocate you, whether
you announce your location, and whether you can receive Zephyrgrams.
The default exposure level is ``realm-visible''.  This means that
anyone who has Kerberos tickets\footnote{You should automatically get
Kerberos tickets when you log into Athena.  See {\em Inessential
Athena} for more details on Kerberos.} can zlocate you, but they will
not receive Zephyrgrams announcing when you log in and log out.  You
can change your Zephyr exposure level using the {\tt zctl set exposure
} command.  The effect of this command is permanent\footnote{ The word
``permanent'' in this document generally refers to a change that will
remain in effect each time you log in, unless you change it again.},
i.e. you will not need to change your exposure each time you log in.
A few useful exposure settings are:

\smallskip
{\tt zctl set exposure realm-announced }

\noindent If you have this exposure setting, you will send automatic Zephyrgrams
``announcing'' when you log in and log out to people who have you
listed in their {\tt .anyone} file and run {\tt znol}.  Anyone with
Kerberos tickets can zlocate you and receive login and logout
announcements from you.

\smallskip
{\tt zctl set exposure net-announced }

\noindent This will send automatic Zephyrgrams ``announcing'' when you
log in and log out to anyone who has you listed in their {\tt .anyone}
file and runs {\tt znol}.  Anyone can zlocate you and receive login
and logout announcements from you, with or without Kerberos
tickets\footnote{The difference between net and realm-announced is
intended to work this way, at least.  In practice, the two exposure
settings tend to be identical.}.

\smallskip
{\tt zctl set exposure opstaff}

\noindent This will allow you to be zlocatable by Operations staff only, but you
can receive Zephyrgrams from anyone who tries to zwrite you.  

\smallskip
 {\tt zctl set exposure none }

\noindent This will prevent anyone from zlocating you and will prevent you from
getting any Zephyrgrams.  This is permanent until you change your
exposure again.   However, it seems to exhibit some strange behavior:
people can still zwrite you without any error messages, so they think
their messages got through.  You won't see their messages, but if you
reset your exposure during the same login session, all the zephyr
messages that were sent to you during that time will suddenly appear.

If you want to temporarily make yourself unzlocatable, or ``hide''
from other users, perhaps to get work done, you can use the {\tt zctl
hide} command.  To undo this, you can use {\tt zctl unhide}.  This
will not stop people from sending you Zephyrgrams, and people who
already know you are logged in will not think you have logged out when
you hide.

\section{Changing the appearance of Zephyrgrams you send}

\subsection{Zsigs}

You can send Zephyrgrams with different ``signatures'', or ``zsigs.''
Your zsig is the line on a Zephyrgram that says ``{\tt From: {\em
zsig} <{\em username}>}''.  Unless you have changed it, your zsig will
be your name as it is listed in your finger information.  You can
change it to read just about anything you want by using the command

\smallskip
 {\tt zctl set zwrite-signature '}{\em mysig}{\tt '}

\noindent which will change your zsig permanently until you use the command
again.  You can also use

\smallskip
 {\tt zwrite -s '}{\em mysig}{\tt ' }{\em username}

\noindent to send a Zephyrgram with the zsig {\em mysig}, for that one
Zephyrgram.

\subsection{All Shapes and Sizes}
You can change the font, size, and appearance of the text of a
Zephyrgram.  You can send Zephyrgrams with boldface or italic text,
and different sizes of text.  To send part of your message in a large
font, you would format it like this:

\smallskip
{\tt @large(}{\em message}{\tt)}

\noindent Only the portion of the message that you enclose in parentheses will
be in large text, so you don't have to make the entire message the
same size or style of text.  You can use any form of bracket to
enclose the portion of the message that you want to be affected,
including [ ], \{ \}, and ( ).  In addition to {\tt @large} you can
use {\tt @small}, or {\tt @huge} to affect the size of text in your
Zephyr messages.  To use boldface or italics, you can use {\tt @bold}
(or {\tt @b}) and {\tt @italic} (or {\tt @i}).  The formatting for all
of these is identical to the example above, replacing {\tt @large}
with the typeface you want to use.

You can also use different fonts in Zephyrgrams.  The three fonts that
are readily available for Zephyrgrams are Courier, Times, and
Helvetica.  Courier is the default font.  To use a different font, you
can use {\tt @{\em fontname}({\em message})} in the text of a message.
For example, to send the message ``hi!''\ in the Helvetica font, you
would type {\tt @helvetica(hi!)}\ as your message.  

You can also send Zephyrgrams with color text, using a slightly
different formatting technique.  To use color, format your message by
typing {\tt @color({\em colorname}){\em message}}.  For example, if
you wanted the message ``I like blue'' to be printed in blue, you
could use {\tt @color(blue)I like blue} as your message.  Unlike
fonts, sizes, and typefaces, this will make your whole message stay
that color, unless you switch it back with another {\tt @color} in the
same message.  Another way to have color text limited to a portion of
the message is to format it like this: {\tt @(@color(blue) I like
blue), but not enough to send completely blue messages.} If you sent
this as your message, the first three words of the message would be
blue. The colors available are listed in the file {\tt
/usr/lib/X11/rgb.txt}.  Note that some colors will be invisible on
some backgrounds, especially on monochrome screens, so you risk
sending unreadable messages to people.

You can also combine font changes and size changes into your zsigs by
using this same formatting when you set the zsig.  You should be
especially aware of using colors in your zsig, since, as mentioned
above, color may be unreadable on certain displays.  Therefore, if you
use the color formatting without the extra parentheses, your username
and message would also be the same possibly invisible color, and
other people wouldn't be able to tell who was zwriting them.  If you
decide to still use color zsigs and risk them being invisible, you
should use the format with the additional parentheses, which we will
repeat here.  You would use something like

\smallskip
{\tt@(@color(blue)I like blue zsigs)}

\noindent and make this your zsig with {\tt zctl set zwrite-signature}.
Although this will make at least your username and message visible to
users, you might still want to think twice about adding large size
text and color to zsigs, as it tends to irritate other users.


\section{Zephyr Classes and Instances}

Using Zephyr classes and instances, you can send and receive
Zephyrgrams which go to more than one recipient.  Effectively, the
main difference between an instance and a class is the privacy level.
Zephyr instances are generally less private and easier to find out
about, and people who send Zephyrgrams over them expect that there
will probably be people reading them who they do not know about.
Zephyr classes are usually more private, and people who send
Zephyrgrams over them generally do not want uninvited people to
eavesdrop on their conversation by receiving and reading
Zephyrgrams on the class.

Zephyr has three parameters that control who will get a Zephyrgram: a
class, an instance, and a recipient.  When you send a Zephyrgram to a
friend, using {\tt zwrite} {\em username}, the class is {\bf message},
the instance is {\bf personal}, and the recipient is your friend's
username.  Different combinations of these parameters are what define
different Zephyr classes and instances.  You can change these
parameters to refer to different classes and instances that you want
to receive messages on, and to refer to a class or instance that you
want to send a particular Zephyrgram to.  Basically, what people call
a Zephyr class refers to changing the class parameter to be something
other than {\bf message}.  What people call a Zephyr instance, or
public instance, refers to changing the instance parameter to
something other than {\bf personal}, while still within the class {\bf
message}.  In the next few sections, we will explain how to change the
class, instance, and recipient parameters to send and receive Zephyrs
to groups of people on different instances and classes.

\subsection{Subscribing to classes and instances}

When you are subscribed to a class or instance, you will see messages
sent to that class or instance.  There are two commands to subscribe
to a class or instance:

\smallskip
{\tt zctl sub} {\em class instance recipient}

\noindent which lasts for your current login session, and

\smallskip
{\tt zctl add} {\em class instance recipient}

\smallskip
\noindent which adds this subscription permanently.

To reverse {\tt zctl sub}, you can use {\tt zctl unsub}.  If you want
to reverse {\tt zctl add}, you can do it permanantly using {\tt zctl
delete}.  To unsubscribe temporarily to a class or instance that you
are permanently subscribed to using {\tt zctl add}, you can use
{\tt zctl unsub}

One additional way to subscribe and unsubscribe to Zephyr classes and
instances is to modify your {\tt .zephyr.subs} file directly.  The
commands {\tt zctl add} and {\tt zctl delete} make permanent changes
because they alter the list of subscriptions in this file.  The format
of a subscription in the {\tt .zephyr.subs} file is {\tt {\em
class},{\em instance},{\em recipient}} (note that there are no spaces
between words).  To update Zephyr subscriptions directly from this
file, you must use the command {\tt zctl load}.  If you want to list
other Zephyr subscriptions in a file other than {\tt .zephyr.subs},
you can load those subscriptions using {\tt zctl load} \verb+~/+{\em
filename}.  Only the subscriptions in your {\tt .zephyr.subs} file are
read when you first log in and run Zephyr; if you want to read
subscriptions from another file automatically, you would need to put
the {\tt zctl load} \verb+~/+{\em filename} command in one of your
startup files.

\subsection{What to Subscribe to}

Now that you know the various ways to set up subscriptions, some
specific examples of subscribing to instances and classes will be
described.

\subsubsection{Instances}

What we generally refer to as Zephyr instances are instances on the
class {\bf message}.  These are often called ``public'' instances.  To
subscribe to the particular instance {\bf help}, you would type

\smallskip
\verb+zctl sub message help \*+.

\noindent In any of these examples, you can also use {\tt zctl add}.  This
would give you a permanent subscription, in this case to the instance
{\em help}.  A permanent subscription to the instance {\bf help} would
show in your {\tt .zephyr.subs} file as the line {\tt message,help,*}

Looking at the above example of a subscription to instance {\bf help},
the {\bf *}
in the recipient field indicates a broadcast message. (You need to
type a \verb+\+ before the {\bf *} so that it is interpreted correctly by
the shell.)  In other words, the {\bf *} means that means that you are
receiving Zephyrgrams that have been sent to everyone who subscribes
to that instance.  The other option for recipient in a Zephyr
subscription is {\tt\%me\%}, which indicates that you are subscribed
to Zephyrgrams sent specifically to you.  This is generally not useful
on an instance such as {\bf help}, which is intended to send messages
to a large number of people, rather than a specific user. The {\bf
help} instance is used by people who want to ask a question, about
anything ranging from using Athena, to progamming, to random facts
about MIT, Boston, history, etc.  If you just want to ask a question,
you probably want to use {\tt zctl sub} to ask it and see the answer,
since there are a lot of Zephyrgrams on this instance, and you may not
want them distracting you when you don't have a question to ask.  Many
knowledgeable people are subscribed to the instance {\bf help}.

Public instances are not limited to the instances people often write
to.  Any public instance (i.e. on the class {\bf message}) that
someone chooses to write to exists when they decide to write to it.
Obviously, you can't explicitly subscribe to each one of these, but
you can explicity subscribe to instances that you know of.  Some
others besides {\bf help} are {\bf white-magic}, which is an instance
for random chatting, {\bf dog}, which is an instance where silly
people bark over Zephyr, and instances like {\bf 6.001}, where people
talk about that particular course.

You can also subscribe to every possible public instance by typing
{\tt zctl sub} \verb+message \* \*+.  In this
case, the * for the instance name acts as a wildcard which subscribes
you to all instances in the class {\bf message}.  The * wildcard for
instances is the reason that instances on class {\bf message} are
called public---anyone who chooses to subscribe to
\verb+message \* \*+ will get Zephyrgrams sent to any instance you
might send to, so there is no way to keep people from finding out
about the instance, and often, from jumping into a conversation on it.
There are actually a number of people who are always subscribed to
``star star'', as it is often called.

If you do want to subscribe to \verb+message \* \*+, there are a few
useful things you might want to know.  First of all, a word of
warning: you will receive a {\bf lot} of Zephyrgrams, which can be
very confusing if you do not customize your dotfiles to make
Zephyrgrams on instances look different from personal Zephyrgrams, and
change where they appear on your screen\footnote{See section 7.4
for examples of how to do this.}.  It is also rather distracting.  To
decrease the volume of Zephyrgrams somewhat, you can filter out
Zephyrgrams on certain instances that you have no interest in reading
by creating ``negative subscriptions'' in your {\tt .zephyr.subs}
file. For each instance you want to filter out, you would add a line
reading {\tt -message,}{\em silly-instance}{\tt ,*} (where {\em
silly-instance} is the name of the instance you want to filter out).
You would then be subscribed to all public instances except those
listed with a minus sign in your {\tt .zephyr.subs} file.  Also, there
is a command called {\tt zpunt} in the {\tt sipb} locker which you can use to
unsubscribe from a particular instance temporarily.  The {\tt zpunt}
command is necessary for people who are subscribed to ``star star''
because using the {\tt zctl unsub} command will not work in this case.
It works in the same way that the ``negative subscriptions'' in your
{\tt .zephyr.subs} file do.  To use {\tt zpunt}, you would type

\smallskip
{\tt add sipb; zpunt }{\em annoying\_instance}

\noindent If you want to resubscribe to that instance before you
logged out, you can type

\smallskip
{\tt zunpunt }{\em annoying\_instance}

\subsubsection{Classes}

What is generally called a Zephyr class, as opposed to a Zephyr
instance, refers to classes (and instances within them) other than
class {\bf message.} These classes are considered to be private
because there is no * wildcard option for the class field.  You must
subscribe to a class explicity.  If you try to subscribe to a class
using \verb+zctl sub \*
\* \*+, you will be subscribed to all the instances on the class named
{\bf *}.  However, the lack of this wildcard does not guarantee absolute
privacy on a Zephyr class.  Listening in on a Zephyr class is as easy
as figuring out what the name of the class is and then subscribing to
it.

Classes are a good thing to use for things like having a place for
members of a living group to chat over Zephyr, or just for a
group of friends to chat, or to send private Zephyrgrams to a number
of people, perhaps about a group project.  If you and your friends
wanted to use a Zephyr class to chat, you could make up a name like
{\bf myfriends} (you would want to choose something private, that other people
would probably not be using already) and then type

\smallskip
\verb+zctl sub myfriends \* \*+

\noindent(Again, you could use {\tt zctl add} instead.)

The {\bf *} for the instance means you will be subscribed to all instances
on class {\bf myfriends}.  This means that your friends could write to
a specific instance within class {\bf myfriends}, perhaps to
distinguish what you are talking about, or just to be silly, and you
would receive the message regardless of which instance they decided to
use.

One class you might want to subscribe to allows you to receive
Zephyrgrams from the post office servers when you get new mail.  To
subscribe to this class, you should use {\tt zctl add mail pop}.  You
probably want to use {\tt add} rather than {\tt sub} so that you will
receive these Zephyrgrams whenever you are logged in.  In your {\tt
.zephyr.subs} file, this will appear as the line {\tt
mail,pop,\%me\%}, indicating that you are only subscribed to messages
on this class with your username as the recipient, and on the instance
{\em pop}.

\subsection{Writing to instances and classes}

\indent {\tt zwrite -i} {\em instancename}

\noindent changes the instance you are sending to from {\bf personal} to {\em
instancename}, and by default sends to the class {\bf message} and the
recipient {\bf *}, which was explained above.  For example, {\tt
zwrite -i help} would send a Zephyrgram to the instance {\bf help},
and anyone who had subscribed would receive the Zephyrgram.

\smallskip
{\tt zwrite -c} {\em classname}

\noindent changes the class you are sending to from {\bf message} to {\em
classname}.  By default, it will send to the instance {\bf personal},
and the recipient {\bf *}.  This means that everyone subscribed to
that class would receive the Zephyrgram.  Using the example class {\bf
myfriends}, {\tt zwrite -c myfriends} would send a zephyr
to the class {\bf myfriends} and the instance {\bf personal}.

\smallskip
{\tt zwrite -c} {\em classname} {\tt -i} {\em instancename}

\noindent sends a Zephyrgram to an instance within the class you are writing to,
instead of to the instance {\bf personal.} Generally, all people
subscribed to a class subscribe to all the instances within that
class, so sending to the instance {\bf silly-name} in the class {\bf
myfriends} would not go to any different people than just sending to
the class {\bf myfriends}.

One thing to note about sending to various Zephyr instances and
classes is that the capitalization you use does not matter.  For
example, {\tt zwrite -i white-magic} is the same as {\tt zwrite -i
WHITE-MAGIC}, which is the same as {\tt zwrite -i WhIte-mAGiC}, etc.
Anyone subscribed to {\bf white-magic} will receive messages sent any
of these ways.

\subsection{Etiquette on Zephyr Instances}

When sending Zephyrgrams to instances, it is best to avoid doing
things that might annoy other users who are subscribed to those
instances.  You should generally avoid things like sending excessively
long messages, having excessively long zsigs, using the font {\tt
@huge}, and using color.  Also, it is customary to send messages that
are not really relevant to the discussion on an instance (for example,
a joke about something said on the instance) to the instance {\em
instancename}{\bf .d }.  This is used particularly for instance {\bf help}
and instances for discussion about classwork.

\section{Four-Letter Words}
	There are two four-letter words that you may notice get used a
lot when talking about Zephyr.  One of these, {\tt zctl}, has appeared
in this document many times already, as part of the commands to change
Zephyr subscriptions, Zephyr exposure levels, and other things.  The
other word, {\tt zwgc}, has not been mentioned yet in this document
but is equally important.  In this section, both the {\tt zwgc} and
{\tt zctl} programs will be introduced, so that you can better
understand how Zephyr actually works.

\subsection{zwgc}

\indent	{\tt Zwgc} stands for {\bf Z}ephyr {\bf W}indow{\bf g}ram {\bf
C}lient.  It is generally pronounced ``zwig-see'' or ``zwigka''.  {\tt Zwgc} is
the program that actually makes Zephyrgrams appear on your screen.  By
default, {\tt zwgc} is started automatically when you log into Athena
on a workstation running X windows.  If you log in through dialup, or
for some other reason you do not have an X display, {\tt zwgc} will
not be able to start properly and you will get the error message: {\tt
zwgc: Unable to open X display -- disabling X driver}.  In order to
enable you to receive Zephyrgrams in these cases, you can use the {\tt
-ttymode} option to {\tt zwgc}:  

\smallskip
{\tt zwgc -ttymode}

\noindent will start the zwgc program so that you can receive Zephyrgrams, but
instead of trying to place them in windowgrams that require an X
display, it will print them to the screen that you are typing in as
text.  (This text is treated only as output, i.e. it will not be read
in as part of the command you were typing when you received the
Zephyrgram, or otherwise interfere with your terminal input.)  You can
also cause {\tt zwgc -ttymode} to start automatically when you log in
through dialup using the following command:


{\tt zctl set fallback true}

\noindent This basically tells {\tt zwgc} that if it can't startup in X, it
should automatically fall back to {\tt zwgc -ttymode}.  Some people prefer to place the line

\smallskip
{\tt zwgc -ttymode}

in their {\tt .startup.tty} file, but this is less efficient, because
it means that the {\tt zwgc} process will try to start up in X, fail,
and then start up in {\tt ttymode} each time you log in on dialup.  In
any case, using {\bf both} of these things together is a mistake, as
you will wind up running the {\tt zwgc -ttymode} process twice and
getting double Zephyr messages.

Since {\tt zwgc} is the program that causes the appearance of
Zephyrgrams on your screen, if you ever want to completely stop
receiving Zephyrgrams, one way you can do this is to stop running {\tt
zwgc} by killing the process.  You could do this by first getting a
list of processes using some form of the command {\tt ps}, and then
searching for the process id that zwgc was started with.  Also, there
is a simple command in the {\tt consult} locker that kills a process.
To kill {\tt zwgc} with it, you would type

\smallskip
{\tt add consult; punt zwgc}


	The {\tt zwgc} program is also responsible for setting the
appearance of Zephyrgrams on your screen.  {\tt Zwgc} looks at a file
called {\tt .zwgc.desc} to find the descriptions of how the
Zephyrgrams should behave.  The default {\tt .zwgc.desc}, which will
be read if you do not create a {\tt .zwgc.desc} with your own
customizations, can be found in {\tt
/usr/athena/lib/zephyr/zwgc.desc}.  More information on customizing
Zephyr with the {\tt .zwgc.desc} file will be discussed in Section 7.

\subsection{zctl}

{\tt Zctl} stands for {\bf Z}ephyr {\bf C}on{\bf t}ro{\bf l}
program.  It is usually pronounced ``zeekootle'' or ``z'ctul'' (Try
reading {\tt zctl} as a word, and however you pronounce it will
probably be about right, as long as you still have your tongue.)  As
we have mentioned in previous sections, you can use {\tt zctl}
to modify your Zephyr subscriptions and  to change your Zephyr
exposure level.  The {\tt zctl} program can be called in two ways:
either by typing the arguments to {\tt zctl} at the command line (i.e.
{\tt zctl add mail pop}, or by just typing {\tt zctl} at the prompt,
and then typing the rest of the command.  The second method allows you
to type {\tt ?} at the {\tt zctl:} prompt and get a list of possible
commands to type if you are unsure of the exact command you want to
use, among other things.  Other useful options in the {\tt zctl}
command include:

\smallskip
{\tt zctl flush\_locs}
 
\noindent This removes ``ghost'' zlocates you might have left from being on a
dialup machine.  It removes all zlocate information, so you need to
use {\tt zctl unhide} to make yourself zlocateable again after this.

\smallskip
{\tt zctl new\_server}

\noindent This allows you to change Zephyr servers, which might be necessary if
you know someone is logged in but for some reason you seem unable to
zwrite them.  Often this means that the Zephyr server you are using
(one of a few machines that control the transmission of all the Zephyr
messages on Athena) is having some problems.  Changing servers will
hopefully help that server to fix itself and get rid of the problems
you are experiencing.

\smallskip
{\tt zctl retrieve}

\noindent This lists all of your current Zephyr subscriptions, so you
can tell if you have temporarily lost any of them because of problems
with the Zephyr servers.

\smallskip
{\tt zctl wg\_read}

\noindent This rereads the information from the {\tt .zwgc.desc} file and updates the
behavior of the windowgrams according to it.

\smallskip
{\tt zctl wg\_shutdown}

\noindent This shuts down the Zephyr WindowGram client, so that you no longer
receive any Zephyrgrams. 

\smallskip
{\tt zctl wg\_startup}

\noindent This reverses {\tt zctl wg\_shutdown} and starts the WindowGram client
again.

\smallskip
{\tt zctl add }{\em class instance recipent}

{\tt zctl delete }{\em class instance recipient}

{\tt zctl sub }{\em class instance recipient}

{\tt zctl unsub }{\em class instance recipient}

\noindent These options to {\tt zctl}, discussed in Section 5.1, are
used to change your Zephyr subscriptions to instances and classes.

\smallskip
{\tt zctl load }

\noindent This is used to reread your Zephyr subscriptions from your
{\tt .zephyr.subs} file, as mentioned in Section 5.1.

\subsection{Zhm}

Although it is a three-letter word, {\tt zhm}, the {\bf Z}ephyr {\bf
H}ost {\bf M}anager, is also important in understanding how Zephyr
works.  {\tt Zhm} is the program that is run on a machine you are
logged into that allows your machine to communicate with the Zephyr
servers.  All Zephyr messages, and error messages about Zephyr, are
transmitted through {\tt zhm}.  Once in a while, you may get an error
message when you are logging in saying something about {\tt
Hostmanager not responding}.  This generally means that for some
reason, the {\tt zhm} process on your machine is not running or is too
slow to be useful.  Therefore, when your other Zephyr processes try to
start, they can't communicate with the Zephyr servers.  If the problem
persists, you can fix this by starting a new {\tt zhm} process on your
machine by typing {\tt su} and then the root password, and then typing

\smallskip
{\tt zhm \&}

{\tt exit}

\noindent to exit from the root shell.
(You would also need to load your Zephyr subscriptions again using
{\tt zctl load} after starting a new {\tt zhm}).


\section {Simple Zephyr Hacks and Customizations}

\indent So, you've gotten this far into the document, and are still interested
in doing more with Zephyr.  We should probably tell you to go tool
instead of wasting all your time on Zephyr, but instead we will cover
various interesting things you can do with Zephyr.

\subsection{zaway}

\indent {\tt Zaway} is a command that you can use to send an automatic message
to everyone who zwrites you saying that you aren't there to read the
message, avcting as a Zephyr answering machine.  Just typing
{\tt zaway} in an xterm will give the default zaway message, with a
zsig of {\tt Automated Reply:}, to anyone who tries to zwrite you
while you have {\tt zaway} running. {\tt zaway} will only respond to
Zephyrgrams sent directly to you, as opposed to on instances or
classes, and will not respond to other {\tt zaway} messages.  People
generally run {\tt zaway} when they are not at their workstations and
want to let friends know that they are not ignoring them. Upon
returning to your workstation, you can stop running zaway by typing
Control-C in the window you started it in.  

One common thing you can do with {\tt zaway} is customizing the {\tt
zaway} messages sent to users.  You can create a file called {\tt
.away} containing the messages you want sent to different users.  Here
is an example {\tt .away} file:

\smallskip
{\tt >joeuser}

{\tt Hi, Joe! I'm not here. Catch ya later.}

{\tt >friend1}

{\tt >friend2}

{\tt Hello, my friend.  As you can see,
 I'm not at this machine right now.}

{\tt >\%}

{\tt Hi there.  I don't seem to be at this machine,

 but I'll read your message and

figure out who you are when I return.}

{\tt >*}

{\tt I'll get back to you when I return!}


\noindent The line(s) following {\tt >joeuser} will be sent in the text of a
reply to joeuser.  The line(s) following {\tt>1friend1} and
{\tt>friend2} will be sent in a reply to either friend1 or friend2.
The line(s) following {\tt >\%} will be sent in a reply to anyone who is
neither friend1, friend2, or joeuser, and the line following {\tt >*}
will be sent in a reply to everyone, including friend1, friend2, and
joeuser.

Another common thing that people do with zaway is to start it
automatically when running {\tt xscreensaver}\footnote{Xscreensaver
can be found in the sipb locker; you can run it by typing add sipb;
xscreensaver.}   To start {\tt zaway} with {\tt xscreensaver}, you can
add the following in your {\tt .Xresources} file:

{\tt xscreensaver*lockCommand:   zaway}

\noindent Then whenever you leave your screen and run xscreensaver, the zaway
messages will automatically inform anyone who zwrite you that you are
not there.

\subsection{Pings}

When you zwrite someone using the normal {\tt zwrite} command, the
first thing that the {\tt zwrite} does is send a ``ping'' to the
person you are zwriting.  This is used to checks whether they are
logged in.  If they are not logged in, Zephyr gives you the message
{\em username}{\tt : Not logged in or not subscribing to messages.}
To zwrite people without sending pings, you can use the option {\tt
zwrite -n}, which saves a bit of time and lessens the load on the
zephyr servers.  

When people use {\tt zwrite} without the {\tt -n} to write to you, you can
intercept these ``pings'' and have them displayed as small
Zephyrgrams, so you know who is about to send messages to you.  To do
this, you will need to modify your {\tt .zwgc.desc} file, which
describes how you want your Zephyrgrams to appear on your screen, to
tell it to display the pings somewhere on your screen.  Then you will
know when people are about to zwrite you.

If you don't yet have a {\tt .zwgc.desc} file\footnote{You can
check by typing \verb+ls -a ~/.zwgc.desc+}, you should first copy the
default {\tt .zwgc.desc} file into your home directory, from the file
{\tt /usr/athena/lib/zephyr/zwgc.desc}.  You should be sure that you
copy it to the file {\bf.}{\tt zwgc.desc}, as the default file does
not have the initial period.  You probably want to have some basic
understanding of how the .zwgc.desc file works so that you can figure
out where to place modifications you want so that they will have the
desired effects.  Sample code to receive pings for personal zephyrs
follows.  A few modifications you might want to make might be to
change the X\_geometry (or leave it out altogether), which determines
where to place the Zephyrgram on the screen, but also leaves that
setting for other Zephyrgrams until you change it in your .zwgc.desc
file for those cases, and to change the message printed in the ping.
You might need to read through your {\tt .zwgc.desc} file to
figure out where the proper location for these lines are; {\tt
.zwgc.desc} hacking is not easy to do by ``formula''.  Here is what
you would need to include:

\smallskip
{\tt match "message"

	if (upcase(\$opcode) == "PING") then

	   if (upcase(\$instance) == "PERSONAL" \&\& upcase(\$class) == "MESSAGE") then

	    set X\_geometry = "+0+20"

	    print "@b("+\$sender+")"

	    print "@small( is about to send you a message)"

	    print "@beep()"

	    put

	    exit

	  endif

	exit

	endif}  


\subsection{Random Zsigs}

Many people have used their copious free time to devise methods of
sending Zephyrgrams through some sort of program that chooses a zsig
randomly from a list of quotes they have chosen.  In this section, I
will suggest two programs that work as zsig randomizers.  The first is
a csh script, written by Ross Lippert, {\tt <ripper>}.  In order to use it, you would
need to put the program into a file (calling it {\tt .zrandom} would
work) and add your zsigs.  Then, after saving the file, you would need
to make it executable using the command {\tt chmod 755 .zrandom}, and
then make an alias such as

\smallskip
\verb+alias zr '~/.zrandom'+ 

\noindent in your {\tt .cshrc.mine} file which you would use to zwrite
with random zsigs.  The program follows:

\begin{verbatim}
#!/bin/csh -f
set zsigs = (\
"Your zsig number 1." \
"Your zsig can not easily deal with apostrophes and quotes." \
"Multi-line zsigs are not possible." \
"Exclamation points must be backlashed like this \!" \
)

set index = `jot -r 1 1 $#zsigs`
if ($index <1 || \$index>$#zsigs) then
        if ($index<0) then
        @ index = - $index
	endif
@ index = $index % $#zsigs
@ index = $index + 1
endif
zwrite -s "$zsigs[$index]" $argv:q
echo "$zsigs[$index]"

\end{verbatim}
The perl randomizer was written by SIPB member Matthew Gray, {\tt
<mkgray>}.  In order to use it, you need to create a file of your
zsigs, which must be called
\verb+~/.zsigs+, and then follow a few steps.  You would put the perl
code into a file, calling it something like {\tt .zrandom}, make the file executable using {\tt chmod 755
.zrandom}, and then alias the execution of the file with a line like

\smallskip
\verb+alias zr '~/.zrandom'+ 

\noindent in your {\tt .cshrc.mine} file.  The code follows:

\begin{verbatim}
#!/afs/athena/contrib/perl/perl
 
srand;
open(ZSIGS, "/mit/$ENV{'USER'}/.zsigs")|| die("No ~/.zsigs file");
$ops = join(' ', @ARGV);
     while(<ZSIGS>){
        chop;
        $sig[$i++]=$_;
    }
    $x = rand($i-1);
    print("Zsig: $sig[$x]\n");
    exec("zwrite", "-d", "-s", $sig[$x], split(' ',$ops));
 
\end{verbatim}

\subsection{Colors and Locations}

There are two main ways to change the colors and locations of your
Zephyrgrams - either through your {\tt .Xresources} file, which can be
used to describes all of your X applications, or through your {\tt
.zwgc.desc} file, which describes only your Zephyrgrams.  People often
change the color and locations of Zephyrgrams for different Zephyr
classes and instances, including things like class {\em login} (for
{\tt znol} login and logout announcements), and class {\em mail} (for
announcements of new mail).

To change locations of Zephyrgrams using the .Xresources file, it is
first useful to understand the way the geometry is specified. This is
best explained by example.  The top left corner of the screen is +0+0. The
first number of this is the X coordinate and the second the Y
coordinate.  The right edge of the screen corresponds to an X
coordinate of -0, and the bottom edge to a Y coordinate of -0.  The
lowercase letter c refers to the center of either the x or y axis.
You can also use any integer to refer to a location on the screen.
+0-20, for example, is near the bottom left corner of the screen, 20
pixels up from the bottom, while -100+100 is 100 pixels away from the
right side of the screen and 100 pixels down from the top of the
screen.

The basic format of an entry to change geometry (location) of
Zephyrgrams in your {\tt .Xresources} is

\smallskip
{\tt zwgc*style}{\em .class.instance}{\tt *geometry:} 	{\em +x-y}

\noindent where {\em +x-y} is any combination of integers, as described above.
Some examples follow:

\begin{verbatim}
zwgc*style.message.personal*geometry:           -0+0
zwgc*style.message.white-magic*geometry:        +c-0
zwgc*style.login*geometry:                      +0+0
zwgc*style.mail*geometry:                       +0+30
\end{verbatim}

These four lines place personal Zephyrgrams in the top right corner of
the screen, Zephyrgrams on instance {\bf white-magic} in the bottom
center of the screen, login and logout Zephyrgrams from {\tt znol} in the
top left corner of the screen, and new mail notification Zephyrgrams just
below login and logout Zephyrgrams in the top left corner of the screen.

To do something similar by editing your {\tt .zwgc.desc file} you
would need to have lines something like this:\footnote{I have included
comments in this code with \#'s, to make clearer what it is actually
doing since you will need to alter this significantly to meet your
needs.  Any line beginning with a \# is a comment, and your
.zwgc.desc will ignore it (whereas you should pay attention to it).}

\begin{verbatim}
case downcase($instance)
#looks at the name of the instance after converting it to lowercase
#since .zwgc.desc is case sensitive
match "white-magic"
#things to do if instance name is white-magic
	set X_geometry = "+c-0"
match "personal"
#things to do if instance name is personal
	set X_geometry = "-0+0"
endcase
#stops looking at instance

case downcase($class)
#looks at the name of the class after converting it to lowercase
#since .zwgc.desc is case sensitive
match "login"
#things to do if class name is login
	set X_geometry = "+0+0"
match "mail"
#things to do if class name is mail
	set X_geometry = "+0+30"
endcase
\end{verbatim}

This code has the same effects as the {\tt .Xresources} entries listed before.
Although it is somewhat longer, some people might opt to use the
{\tt .zwgc.desc} method because one could then also include other
customizations to {\tt .zwgc.desc} for those particular classes and
instances at the same time.  For example, you can change the way a message
is formatted\footnote{The best way to learn how to do this is to look
at other people's {\tt .zwgc.desc} files and pick up what the various
commands are doing.  Some examples can be found in the {\tt dotfiles}
locker.  One particular {\tt .zwgc.desc} file you might want to look
at is rjbarbal's, which you can find in {\tt
/mit/dotfiles/Zwgc.desc/rjbarbal.zwgc.desc}.  (You need to type {\tt
attach dotfiles} first.)}.

To get different colored zephyrs, you can modify your .Xresources file.
The basic format of {\tt .Xresources} entries for foreground and background
colors for Zephyrgrams is:

{\tt zwgc.style}{\em .class.instance}{\tt *background:}     {\em  color}

{\tt zwgc.style}{\em .class.instance}{\tt *foreground:}     {\em  color}

\noindent To avoid problems when you don't have a color screen, you can place
your color preferences after a line reading

\verb+#ifdef COLOR+

\noindent and follow them with a line reading

\verb+#endif+

\noindent An example follows:
\begin{verbatim}
#ifdef COLOR

zwgc.style.login*background:                            LawnGreen
zwgc.style.login*foreground:                            MidnightBlue
zwgc.style.message.white-magic*background:              purple
zwgc.style.message.white-magic*foreground:              white
zwgc.style.message.personal*background:                 blue
zwgc.style.message.personal*foreground:                 yellow
zwgc.style.mail*background:                             red
zwgc.style.mail*foreground:                             black

#endif
\end{verbatim}

These lines would cause login announcements to show up as MidnightBlue
on LawnGreen, {\bf white-magic} Zephyrgrams to show up as white on purple,
personal messages to show up as yellow on blue, and mail notification
to show up as red on black.


\subsection{How To Ignore People}

People often express interest in doing something like hiding from a
specific user, so that they can't zwrite you and don't know that you
are logged in, while everyone else can zwrite you.  Zephyr is not
actually capable of doing this completely.  You can never set it up
so that Zephyr will give a {\em yourusername:} {\tt not logged in or
not subscribing to messages} error message to some people and not to
others.  However, there is a way to edit your .zwgc.desc to filter out
Zephyrgrams from any users you wish, and to send a zaway-type message
to them saying something to inform them that you are not receiving
their messages.  Again, the .zwgc.desc lines that do this will be
explained with comments in the code.  Here is the code:

\begin{verbatim}
# punting a user
# zctl set username punt
# zctl unset username
        set test = zvar($sender)
# take the sender's username, and assign it to a variable called test

        if ($test == "punt") then
#if the sender's username has been set to punt

	if (upcase($instance) == "PERSONAL" && upcase($class)=="MESSAGE") then
# if it is also a personal zephyr sent only to you

        exec "zwrite" "-q" "-n" $sender "-m"
        "Your zephyr is not being received at this time."
# send them a message, and don't print the zephyr
# you should not have a return between the -m and the message
                        exit
                endif
                exit
        endif
# exit from the .zwgc.desc without printing any zephyrs
\end{verbatim}

Then, in order to ``punt'' a particular user's Zephyrgrams\footnote{For this to work immediately after you have edited and saved
your {\tt .zwgc.desc} file, you would first need to type the command
{\tt zctl wg\_read} to make your changes take effect.}, you can type

\smallskip
{\tt zctl set} {\em username} {\tt "punt"}

\noindent and to ``unpunt'' them (see their Zephyrgrams again and stop ignoring
them), you can type

\smallskip
{\tt zctl unset} {\em username}

One interesting thing to note about this is that the basic methods
used in this code sample allow you to make your own zephyr variables
and then set them from your {\tt athena\%} prompt using {\tt zctl
set}.  So if you want a customization to only happen when you
explicity say so, you could make up the name of a variable, and use
{\tt zvar} to make it a variable.  Then you could have if statements
in your {\tt .zwgc.desc} that will execute the customization for
certain values of that variable.

In your {\tt .zwgc.desc}, before you use it as a variable, you need to
add a line that says something like

{\tt set {\em variable} = zvar(\${\em variable})}

\noindent  Then to change its value you would type

\smallskip
{\tt zctl set} {\em variable value}

\noindent For variables that you want to set to values like ``punt'' or ``true'',
you would have to quote the word that you want to be the value, in
both assigning the value with {\tt zctl set} and in testing the value
in {\tt .zwgc.desc}.
 
\subsection{Logging your Zephyrs}

You can log Zephyrgrams to a file as well as receiving them on your screen
with fairly simple additions to your .zwgc.desc.

If you want to save the complete Zephyrgram (everything you see on
your screen), you should add the following things to your {\tt
.zwgc.desc} file.  First, near the beginning of the file, before any
of the code that actually places and formats Zephyrgrams, you need to
add the line

\smallskip
{\tt appendport "outf" getenv("HOME")+"/.zlog" }

\noindent which basically tells {\tt .zwgc.desc} that ``outf'' refers to a file
in your home directory called {\tt .zlog}.

Then, wherever you want a particular kind of Zephyrgram (like personal
Zephyrgrams, or all Zephyrgrams to a particular instance) to be logged
in the file, you would need to find where those Zephyrgrams are
specified in the {\tt .zwgc.desc} file and add the line

\smallskip
{\tt put "outf"}

\noindent after the line that should already be there that says just {\tt put}.

Another thing that can easily done with this is to log Zephygrams only
if a certain variable is set\footnote{Setting variables was
mentioned in section 7.6, and will be reviewed here.}.  To do this,
instead of just adding the {\tt put "outf"} line mentioned above, you
would add several lines of code.  Near the beginning of your {.zwgc desc}, you would put the line:

\smallskip
{\tt set log = zvar("log")}

\noindent Then, in the locations where the Zephyrgrams you want to log are
dealt with, instead of just putting {\tt put "outf"}, you would add
the lines

\begin{verbatim}
if ($log == "true") then
put "outf"
endif
\end{verbatim}

\noindent Then, to start logging Zephyrs, you would need to type

\smallskip
{\tt zctl set log "true"}

\noindent and to stop logging them, you would need to type

\smallskip
{\tt zctl unset log}

 
\subsection{Langwrite}

You can send Zephygrams with accents and other symbols used in some
foreign languages with the help of a program called {\tt langwrite}.
Langwrite is in the {\tt potluck} locker, so in order to access it you would
need to type

\smallskip
{\tt add potluck}

\noindent To find exact details on how langwrite works, you should type

\smallskip
{\tt add potluck}

{\tt man langwrite}

\noindent Then, to use langwrite with Zephyr, you would type

\smallskip
{\tt langwrite | zwrite username}

\noindent to send the output of the langwrite program over Zephyr as the message.

\subsection{Other ways of using znol and zwrite}

One of the simplest hacks you can do with {\tt znol} is to have your
znol list of who is logged on be sent to you as a Zephyrgram instead
of being in the xterm where you typed the command.  This is done with
UNIX redirection, sending the output of the znol program to zwrite as
the message.  To do this, you would type

\smallskip
{\tt znol | zwrite} {\em yourusername}

Another popular program which many people use to replace both {\tt
znol} and {\tt zwrite} is called {\tt xzewd.} This program is NOT
supported by SIPB.  It was written by a user, Eddie Kohler,
{\tt<eddietwo>}.  It is an X application that gives you lots of
windows with silly graphics for your znol list and for sending Zephyrs
from.  In order to use xzewd, you need to type

\smallskip
{\tt add eddietwo; xzewd \&}

\noindent If you have problems with xzewd, you should bring them to {\tt
eddietwo@athena.mit.edu}.

Other programs that some people use include {\tt xznol} and {\tt
xzwrite}.  {\tt xzwrite} can be found in the standard athena release.
To read more about it, type

\smallskip
{\tt man xzwrite}

\noindent {\tt xznol} is written by a SIPB member, Marc Horowitz, {\tt<marc>}.  For more information about it, you need to type

\smallskip
{\tt add marc; man xznol}

\noindent Both of these programs are X applications that do similar things to
{\tt znol} and {\tt zwrite}, in their own window rather than from an xterm.


\section{Where to Find More Information}

To start with, you can read manual pages on various things related to
Zephyr.  Some helpful ones include {\tt man zwgc}, {\tt man zwrite},
and {\tt man zctl.} Also, looking in the {\tt dotfiles} locker and at
various people's world-readable {\tt .zwgc.desc} files can give you
more ideas about Zephyr customizations.  You can also read through the
On-Line Consultants' stock answers on Zephyr, by typing {\tt
olc\_answers} and choosing the menu item on Zephyr.  On-Line Help
(OLH) also has information on Zephyr, which can be found by typing
{\tt help \&} and choosing the menu item ``Communicating with other
Users.''

You can also feel free to visit the SIPB office in W20-557, right next
to the Athena Cluster in the Student Center, or call us at 253-7788
and ask us whatever you are interested in finding out.  The Student
Information Processing Board (SIPB) is a volunteer student
organization who help computer users at MIT and provide many services
to the user community.  You can stop by and ask us anything you'd like
to know, about any computing-related topic, and we'll try our best to
answer.

\end{document}
