Subject: Re: new mail sound
From: Andrew Richards <[email-masked]>
To: [email-masked]
Date: Fri, 8 Jul 1994 23:04:45 -0700

--------

The following is the solution I came up with to the problem those of us with 
practically mute xterminals have when new mail arrives. ie no audio 
notification

It's pretty simple but it works for me running Solaris 2.3 and will probably 
work for you.

All you have to do is set the audio-play command to the path of xbell 
(attached) and set the sound for new messages to 3 (say) and the xserver will 
beep 3 times when new mail arrives.

=====================================================================
|  Andrew Richards                              Physics Department  |
|                                                   Canterbury      |
| E-Mail:  [email-masked]        New  Zealand     |
|-------------------------------------------------------------------|
|            WANTED:  Schrodinger's cat, dead or alive.             |
=====================================================================
/* xbell - a program to ring the bell on an xterminal                        */
/*                                                                           */
/* written by Andrew Richards ([email-masked]) 9 July 1994 */
/*                                                                           */
/* Syntax: xbell number-of-beeps                                             */
/*                                                                           */
/* Compile with:                                                             */
/* cc -I/usr/local/X11/include xbell.c -L/usr/local/X11/lib -lX11 \          */
/*    -R/usr/local/X11/lib -lsocket -o xbell                                 */
/*                                                                           */
/* under SOLARIS 2.3 and similar for most others I would imagine             */

#include <X11/Xlib.h>

main(int argc, char **argv)
{
  int cnt,number=3;
  Display *display;

  if ((argc>1) && ((number = atoi(argv[1]))>0)) {
    if ((display = XOpenDisplay(NULL)) == NULL) {
      printf("Couldn't open display %s\n", XDisplayName(display));
      exit (-1);
    }

    for(cnt=0;cnt<number;cnt++) {
      XBell(display,100);
    }

    XCloseDisplay(display);
  }
  else {
    printf("Syntax: %s <number of beeps>\n",argv[0]);
  }
}