Inessential Zephyr

The Student Information Processing Board

Abbe Cohen August 23, 1993

1 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^{1}. 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

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

2 Who’s out there?

To look for a user, you can use the command

zlocate username which will either give you the name of the machine the user is logged in on, or tell you that the user is 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^{2}.

If you want to check whether a whole list of people are logged in, you can use the znol command. First, you need to create a file called .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

   znol

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

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

znol -u username, 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 znol normally, so you can basically add individual users to the list of people you want to check on without adding them to your .anyone file.

You can use the -f option to use a file other than .anyone as the list of people. For instance, you might list the usernames of members of a club in a file called .anyone.club, and check if any of them

are logged in with znol -f ~/.anyone.club.

3 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^{4} 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 zctl set exposure command. The effect of this command is permanent^{5}, i.e. you will not need to change your exposure each time you log in. A few useful exposure settings are:

1You can also use Zephyr in text on dialup. See section 6.6 for more information

2See Section 3 for information on how to avoid being zlocated.

3See section 3 for information about login and logout Zephyrgrams.

4You should automatically get Kerberos tickets when you log into Athena. See Inessential Athena for more details on Kerberos.

   zctl set exposure realm-announced

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 .anyone file and run znol. Anyone with Kerberos tickets can zlocate you and receive login and logout announcements from you.

   zctl set exposure net-announced

This will send automatic Zephyrgrams “announcing” when you log in and log out to anyone who has you listed in their .anyone file and runs znol. Anyone can zlocate you and receive login and logout announcements from you, with or without Kerberos tickets^{6}.

   zctl set exposure opstaff

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

   zctl set exposure none

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 zctl hide command. To undo this, you can use 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.

4 Changing the appearance of Zephyrgrams you send

4.1 Zsigs

You can send Zephyrgrams with different “signatures”, or “zsigs.” Your zsig is the line on a Zephyrgram that says “From: zsig <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

   zctl set zwrite-signature 'mysig'

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

zwrite -s 'mysig' username to send a Zephyrgram with the zsig mysig, for that one Zephyrgram.

4.2 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:

5The 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.

6The difference between net and realm-announced is intended to work this way, at least. In practice, the two exposure settings tend to be identical.

   @large(message)

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 @large you can use @small, or @huge to affect the size of text in your Zephyr messages. To use boldface or italics, you can use @bold (or @b) and @italic (or @i). The formatting for all of these is identical to the example above, replacing @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 @fontname(message) in the text of a message. For example, to send the message “hi!” in the Helvetica font, you would type @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 @color(colorname)message. For example, if you wanted the message “I like blue” to be printed in blue, you could use @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 @color in the same message. Another way to have color text limited to a portion

of the message is to format it like this: @(@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 /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

   @(@color(blue)I like blue zsigs)

and make this your zsig with 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.

5 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 zwrite username, the class is message, the instance is 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 message. What people call a Zephyr instance, or public instance, refers to changing the instance parameter to something other than personal, while still within the class 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.

5.1 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:

zctl sub class instance recipient which lasts for your current login session, and

zctl add class instance recipient which adds this subscription permanently.

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

One additional way to subscribe and unsubscribe to Zephyr classes and instances is to modify your .zephyr.subs file directly. The commands zctl add and zctl delete make permanent changes because they alter the list of subscriptions in this file. The format of a subscription in the .zephyr.subs file is class,instance,recipient (note that there are no spaces between words). To update Zephyr subscriptions directly from this file, you must use the command zctl load. If you want to list other Zephyr subscriptions in a file other than .zephyr.subs, you can load those subscriptions using zctl load ~/filename. Only the subscriptions in your .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 zctl load ~/filename command in one of your startup files.

5.2 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.

Instances

What we generally refer to as Zephyr instances are instances on the class message. These are often called “public” instances. To subscribe to the particular instance help, you would type

   zctl sub message help \*.

In any of these examples, you can also use zctl add. This would give you a permanent subscription, in this case to the instance help. A permanent subscription to the instance help would show in your

.zephyr.subs file as the line message,help,*

Looking at the above example of a subscription to instance help, the * in the recipient field indicates a broadcast message. (You need to type a \ before the * so that it is interpreted correctly by the shell.) In other words, the * 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 %me%, which indicates that you are subscribed to Zephyrgrams sent specifically to you. This is generally not useful on an instance such as help, which is intended to send messages to a large number of people, rather than a specific user. The 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 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 help.

Public instances are not limited to the instances people often write to. Any public instance (i.e. on the class 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 help are white-magic, which is an instance for random chatting, dog, which is an instance where silly people bark over Zephyr, and instances like 6.001, where people talk about that particular course.

You can also subscribe to every possible public instance by typing zctl sub message \* \*. In this case, the * for the instance name acts as a wildcard which subscribes you to all instances in the class message. The * wildcard for instances is the reason that instances on class message are called public—anyone who chooses to subscribe to 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 message \* \*, there are a few useful things you might want to know. First of all, a word of warning: you will receive a 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^{7}. 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 .zephyr.subs file. For each instance you want to filter out, you would add a line reading -message,silly-instance,* (where 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 .zephyr.subs file. Also, there is a command called zpunt in the sipb locker which you can use to unsubscribe from a particular instance temporarily. The zpunt command is necessary for people who are subscribed to “star star” because using the zctl unsub command will not work in this case. It works in the same way that the “negative subscriptions” in your .zephyr.subs file do. To use zpunt, you would type

add sipb; zpunt annoying instance If you want to resubscribe to that instance before you logged out, you can type

zunpunt annoying instance

Classes

What is generally called a Zephyr class, as opposed to a Zephyr instance, refers to classes (and instances within them) other than class 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 zctl sub \* \* \*, you will be subscribed to all the instances on the class named *. 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.

7See section 7.4 for examples of how to do this.

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 myfriends (you would want to choose something private, that other people would probably not be using already) and then type

   zctl sub myfriends \* \*

(Again, you could use zctl add instead.)

The * for the instance means you will be subscribed to all instances on class myfriends. This means that your friends could write to a specific instance within class 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 zctl add mail pop. You probably want to use add rather than sub so that you will receive these Zephyrgrams whenever you are logged in. In your .zephyr.subs file, this will appear as the line mail,pop,%me%, indicating that you are only subscribed to messages on this class with your username as the recipient, and on the instance pop.

5.3 Writing to instances and classes

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

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

zwrite -c classname -i instancename sends a Zephyrgram to an instance within the class you are writing to, instead of to the instance personal. Generally, all people subscribed to a class subscribe to all the instances within that class, so sending to the instance silly-name in the class myfriends would not go to any different people than just sending to the class myfriends.

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

5.4 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 @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 instancename.d . This is used particularly for instance help and instances for discussion about classwork.

6 Four-Letter Words

There are two four-letter words that you may notice get used a lot when talking about Zephyr. One of these, 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, zwgc, has not been mentioned yet in this document but is equally important. In this section, both the zwgc and zctl programs will be introduced, so that you can better understand how Zephyr actually works.

6.1 zwgc

Zwgc stands for Zephyr Windowgram Client. It is generally pronounced “zwig-see” or “zwigka”. Zwgc is the program that actually makes Zephyrgrams appear on your screen. By default, 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, zwgc will not be able to start

properly and you will get the error message: zwgc:  Unable to open X display -- disabling X

driver. In order to enable you to receive Zephyrgrams in these cases, you can use the -ttymode option

to zwgc:
   zwgc -ttymode

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 zwgc -ttymode to start automatically when you log in through dialup using the following command:

   zctl set fallback true

This basically tells zwgc that if it can’t startup in X, it should automatically fall back to zwgc -ttymode. Some people prefer to place the line

   zwgc -ttymode

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

Since 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 zwgc by killing the process. You could do this by first getting a list of processes using some form of the command ps, and then searching for the process id that zwgc was started with. Also, there is a simple command in the consult locker that kills a process. To kill zwgc with it, you would type

   add consult; punt zwgc

The zwgc program is also responsible for setting the appearance of Zephyrgrams on your screen. Zwgc looks at a file called .zwgc.desc to find the descriptions of how the Zephyrgrams should behave.

The default .zwgc.desc, which will be read if you do not create a .zwgc.desc with your own customizations, can be found in /usr/athena/lib/zephyr/zwgc.desc. More information on customizing Zephyr with the .zwgc.desc file will be discussed in Section 7.

6.2 zctl

Zctl stands for Zephyr Control program. It is usually pronounced “zeekootle” or “z’ctul” (Try reading 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 zctl to modify your Zephyr subscriptions and to change your Zephyr exposure level. The zctl program can be called in two ways: either by typing the arguments to zctl at the command line (i.e. zctl add mail pop, or by just typing zctl at the prompt, and then typing the rest of the command. The second method allows you to type ? at the 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 zctl command include:

   zctl flush locs

This removes “ghost” zlocates you might have left from being on a dialup machine. It removes all zlocate information, so you need to use zctl unhide to make yourself zlocateable again after this.

   zctl new server

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.

   zctl retrieve

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.

   zctl wg read

This rereads the information from the .zwgc.desc file and updates the behavior of the windowgrams according to it.

   zctl wg shutdown

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

   zctl wg startup

This reverses zctl wg shutdown and starts the WindowGram client again.

zctl add class instance recipent

zctl delete class instance recipient

zctl sub class instance recipient

zctl unsub class instance recipient These options to zctl, discussed in Section 5.1, are used to change your Zephyr subscriptions to instances and classes.

   zctl load

This is used to reread your Zephyr subscriptions from your .zephyr.subs file, as mentioned in Section 5.1.

6.3 Zhm

Although it is a three-letter word, zhm, the Zephyr Host Manager, is also important in understanding how Zephyr works. 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 zhm. Once in a while, you may get an error message when you are logging in saying something about Hostmanager not responding. This generally means that for some reason, the 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 zhm process on your machine by typing su and then the root password, and then typing

   zhm &
   exit

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

7 Simple Zephyr Hacks and Customizations

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.

7.1 zaway

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 zaway in an xterm will give the default zaway message, with a zsig of Automated Reply:, to anyone who tries to zwrite you while you have zaway running. zaway will only respond to Zephyrgrams sent directly to you, as opposed to on instances or classes, and will not respond to other zaway messages. People generally run 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 zaway is customizing the zaway messages sent to users. You can create a file called .away containing the messages you want sent to different users. Here is an example .away file:

   >joeuser
   Hi, Joe!  I'm not here.  Catch ya later.
   >friend1
   >friend2
   Hello, my friend.  As you can see, I'm not at this machine right now.
   >%
   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.
   >*
   I'll get back to you when I return!

The line(s) following >joeuser will be sent in the text of a reply to joeuser. The line(s) following >1friend1 and >friend2 will be sent in a reply to either friend1 or friend2. The line(s) following >% will be sent in a reply to anyone who is neither friend1, friend2, or joeuser, and the line following >* 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

xscreensaver^{8} To start zaway with xscreensaver, you can add the following in your .Xresources

file:

   xscreensaver*lockCommand:  zaway

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

7.2 Pings

When you zwrite someone using the normal zwrite command, the first thing that the 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 username: Not logged in or not subscribing to messages. To zwrite people without sending pings, you can use the option zwrite -n, which saves a bit of time and lessens the load on the zephyr servers.

When people use zwrite without the -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 .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 .zwgc.desc file^{9}, you should first copy the default .zwgc.desc file into your home directory, from the file /usr/athena/lib/zephyr/zwgc.desc. You should be sure that you copy it to the file .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 .zwgc.desc file to figure out where the proper location for these lines are; .zwgc.desc hacking is not easy to do by “formula”. Here is what you would need to include:

   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

8Xscreensaver can be found in the sipb locker; you can run it by typing add sipb; xscreensaver.

9You can check by typing ls -a /.zwgc.desc

   exit
   endif

7.3 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, <ripper>. In order to use it, you would need to put the program into a file (calling it .zrandom would work) and add your zsigs. Then, after saving the file, you would need to make it executable using the command chmod 755 .zrandom, and then make an alias such as

   alias zr '~/.zrandom'

in your .cshrc.mine file which you would use to zwrite with random zsigs. The program follows:

#!/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]"

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

   alias zr '~/.zrandom'

in your .cshrc.mine file. The code follows:

#!/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));

7.4 Colors and Locations

There are two main ways to change the colors and locations of your Zephyrgrams - either through your .Xresources file, which can be used to describes all of your X applications, or through your .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 login (for znol login and logout announcements), and class 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 .Xresources is

   zwgc*style.class.instance*geometry: +x-y

where +x-y is any combination of integers, as described above. Some examples follow:

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

These four lines place personal Zephyrgrams in the top right corner of the screen, Zephyrgrams on instance white-magic in the bottom center of the screen, login and logout Zephyrgrams from 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 .zwgc.desc file you would need to have lines something like this:^{10}

case downcase($instance)
#looks at the name of the instance after converting it to lowercase
#since .zwgc.desc is case sensitive
match "white-magic"

10I 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).

#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

This code has the same effects as the .Xresources entries listed before. Although it is somewhat longer, some people might opt to use the .zwgc.desc method because one could then also include other customizations to .zwgc.desc for those particular classes and instances at the same time. For example, you can change the way a message is formatted^{11}.

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

   zwgc.style.class.instance*background: color
   zwgc.style.class.instance*foreground: color

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

   #ifdef COLOR

and follow them with a line reading

   #endif

An example follows:

#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

11The best way to learn how to do this is to look at other people’s .zwgc.desc files and pick up what the various commands are doing. Some examples can be found in the dotfiles locker. One particular .zwgc.desc file you might want to look at is rjbarbal’s, which you can find in /mit/dotfiles/Zwgc.desc/rjbarbal.zwgc.desc. (You need to type attach dotfiles first.)

zwgc.style.mail*foreground:                             black
#endif

These lines would cause login announcements to show up as MidnightBlue on LawnGreen, whitemagic 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.

7.5 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 yourusername: 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:

# 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

Then, in order to “punt” a particular user’s Zephyrgrams^{12}, you can type

   zctl set username "punt"

and to “unpunt” them (see their Zephyrgrams again and stop ignoring them), you can type

   zctl unset username

12For this to work immediately after you have edited and saved your .zwgc.desc file, you would first need to type the command zctl wg read to make your changes take effect.

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 athena% prompt using 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 zvar to make it a variable. Then you could have if statements in your .zwgc.desc that will execute the customization for certain values of that variable.

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

set variable = zvar($variable) Then to change its value you would type

zctl set variable value 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 zctl set and in testing the value in

.zwgc.desc.

7.6 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 .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

   appendport "outf" getenv("HOME")+"/.zlog"

which basically tells .zwgc.desc that “outf” refers to a file in your home directory called .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 .zwgc.desc file and add the line

   put "outf"

after the line that should already be there that says just put.

Another thing that can easily done with this is to log Zephygrams only if a certain variable is set^{13}. To do this, instead of just adding the put "outf" line mentioned above, you would add several lines of code. Near the beginning of your .zwgc desc, you would put the line:

   set log = zvar("log")

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

if ($log == "true") then
put "outf"
endif

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

   zctl set log "true"

and to stop logging them, you would need to type

   zctl unset log

13Setting variables was mentioned in section 7.6, and will be reviewed here.

7.7 Langwrite

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

   add potluck

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

   add potluck
   man langwrite

Then, to use langwrite with Zephyr, you would type

   langwrite | zwrite username

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

7.8 Other ways of using znol and zwrite

One of the simplest hacks you can do with 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

znol | zwrite yourusername

Another popular program which many people use to replace both znol and zwrite is called xzewd. This program is NOT supported by SIPB. It was written by a user, Eddie Kohler, <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

   add eddietwo; xzewd &

If you have problems with xzewd, you should bring them to eddietwo@athena.mit.edu.

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

   man xzwrite

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

   add marc; man xznol

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

8 Where to Find More Information

To start with, you can read manual pages on various things related to Zephyr. Some helpful ones include man zwgc, man zwrite, and man zctl. Also, looking in the dotfiles locker and at various people’s world-readable .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 olc answers and choosing the menu item on Zephyr. On-Line Help (OLH) also has information on Zephyr, which can be found by typing 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.