Article View: comp.sys.sun
Article #10232Re: Ringing the bell in calentool (pa
From: Craig Sarazin
Date: Fri, 13 Jan 1989 11:32
Date: Fri, 13 Jan 1989 11:32
62 lines
2663 bytes
2663 bytes
I recently asked if anyone knew how to make calentool ring the bell when
it notifies you of appointments. Calentool is a very useful utility for
keeping track of appointments. I received a number of replies. Bill
Randle <billr%saab.cna.tek.com@relay.cs.net>, who has made many very
useful improvements to calentool, told me that later versions of calentool
include a "-b" option which beeps the bell and sends a message to the
console reminding you of an upcoming appointment (at the same time that
the icon reverse video's). Randle also said that he will be posting a new
version of calentool in the not too distant future with lots more bells
and whistles.
The simplest, most robust patch to Version 1.4 of calentool which makes
the bell ring when the icon changes to reverse came from John Scott
<scott@dg-rtp.dg.com>. The rest of this message lists the changes to the
calentool.c file needed to make this changes.
Many thanks to John Scott, Bill Randle, and many other people who offered
suggestions and advise.
Craig Sarazin cls7i@virginia (BITNET)
Dept. of Astronomy cls7i@virginia.edu
University of Virginia
Differences to calentool.c, version 1.4
*************************************************************************
0a1
> /* Modified Oct 21, 1988 to ring bell at appointment */
94a96
> int inverted = 0;
434a437
> inverted = 0;
435a439,444
> /* ring bell twice */
> if (!inverted) {
> RINGER(); RINGER();
> inverted++;
> }
>
439a449,471
> }
> #include <sundev/kbd.h>
> #include <sundev/kbio.h>
> RINGER()
> {
> struct timeval timer;
> register int kbd, op;
> int cmd;
>
> timer.tv_sec = 0;
> if ((kbd = open("/dev/kbd", 1)) > -1) {
> cmd = KBD_CMD_BELL;
> timer.tv_usec = 100000;
>
> ioctl(kbd, KIOCCMD, &cmd);
> select(32, 0,0,0, &timer);
> cmd = KBD_CMD_NOBELL;
> ioctl(kbd, KIOCCMD, &cmd);
>
> timer.tv_usec = 333333;
> select(32, 0,0,0, &timer);
> close(kbd);
> }
Technical Details
Message-ID:
<8901051423.AA02024@astsun2.acc.Virginia.EDU>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!cornell!uw-beaver!rice!sun-spots-requestShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!cornell!uw-beaver!rice!sun-spots-request From: cls7i@astsun2.acc.virginia.edu (Craig Sarazin) Newsgroups: comp.sys.sun Subject: Re: Ringing the bell in calentool (pa Message-ID: <8901051423.AA02024@astsun2.acc.Virginia.EDU> Date: 13 Jan 89 11:32:18 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 62 Approved: Sun-Spots@rice.edu Original-Date: Thu, 5 Jan 89 09:23:21 EST X-Sun-Spots-Digest: Volume 7, Issue 100, message 11 of 11