How to display PINGS from other users
Between the time you type your zwrite command and actually start entering
the text of your message, there is something called a "ping" that gets
sent to the recipient of your message. This ping is used by the sender's
zwrite process to determine if the recipient is logged on.
It may be desirable to display a message when your machine receives a zephyr
ping, so you know when someone is writing to you. This is easily
possible, and requires a small addition to your .zwgc.desc file. If you
do not have such a file, you can copy the default one into your directory
by typing:
cp /usr/athena/share/zephyr/zwgc.desc ~/.zwgc.desc
You then need to change the permissions on this file so that you can
edit it by typing:
chmod u+w ~/.zwgc.desc
In this default file, you'll see a few lines that say this:
# Opcode "ping" is used by sender programs to see if the message would
# really get sent, or if the recipient has logged out. No useful
# information is normally contained in these messages, so we discard them.
if (upcase($opcode) == "PING") then exit endif
This tells zephyr to merely discard ping messages; to actually display a
message for them, replace the last line with the following:
if (upcase($opcode) == "PING") then
if (upcase($instance) == "PERSONAL") then
print "Ping from "+$sender+"\n"
put
endif
exit
endif
Once you've done this, zephyr will display a notice for pings starting the
next time you log in, or start a zephyr process. If you want the change
to take place immediately, you can tell zephyr to reread the file you just
changed by typing at the athena% prompt:
zctl wg_read
NOTE: You will NOT be notified if the sender uses the "-n" option to the
zwrite command, which suppresses the initial ping. For example:
zwrite -n jo
would not send out the notification.
For more example fragments like this, you can examine the directories
/mit/zephyr/examples, and /mit/dotfiles/Zwgc.desc by typing:
attach zephyr
cd /mit/zephyr/examples
or
attach dotfiles
cd /mit/dotfiles/Zwgc.desc
|