home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume18 / xalarm30 / part05 < prev    next >
Encoding:
Text File  |  1992-07-07  |  43.7 KB  |  1,496 lines

  1. Path: uunet!sun-barr!ames!elroy.jpl.nasa.gov!swrinde!mips!msi!dcmartin
  2. From: S.Marshall@sequent.cc.hull.ac.uk (Simon Marshall)
  3. Newsgroups: comp.sources.x
  4. Subject: v18i006: Xalarm 3.04, Part05/05
  5. Message-ID: <1992Jul8.154543.20631@msi.com>
  6. Date: 8 Jul 92 15:45:43 GMT
  7. References: <csx-18i002-xalarm-3.04@uunet.UU.NET>
  8. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  9. Organization: Molecular Simulations, Inc.
  10. Lines: 1482
  11. Approved: dcmartin@msi.com
  12. Originator: dcmartin@fascet
  13.  
  14. Submitted-by: Simon Marshall <S.Marshall@sequent.cc.hull.ac.uk>
  15. Posting-number: Volume 18, Issue 6
  16. Archive-name: xalarm-3.04/part05
  17.  
  18. # this is part.05 (part 5 of a multipart archive)
  19. # do not concatenate these parts, unpack them in order with /bin/sh
  20. # file xalarm.c continued
  21. #
  22. if test ! -r _shar_seq_.tmp; then
  23.     echo 'Please unpack part 1 first!'
  24.     exit 1
  25. fi
  26. (read Scheck
  27.  if test "$Scheck" != 5; then
  28.     echo Please unpack part "$Scheck" next!
  29.     exit 1
  30.  else
  31.     exit 0
  32.  fi
  33. ) < _shar_seq_.tmp || exit 1
  34. if test ! -f _shar_wnt_.tmp; then
  35.     echo 'x - still skipping xalarm.c'
  36. else
  37. echo 'x - continuing file xalarm.c'
  38. sed 's/^X//' << 'SHAR_EOF' >> 'xalarm.c' &&
  39. X     * will soon realise that there was something wrong...
  40. X     */
  41. X    if ((ISINVALID (xalarm.dateout)) or
  42. X    (ISINVALID (xalarm.timeout)) or
  43. X    (ISINVALID (xalarm.numwarnings)) or
  44. X    (xalarm.confirm and ((xalarm.timeout != 0) or (xalarm.dateout != 0))))
  45. X    PopupAndAsk ();
  46. X    else
  47. X    AddTimeOuts ();
  48. X
  49. X    (void) XSetIOErrorHandler ((void *) AlarmDying);
  50. X    (void) signal (SIGUSR1, (SIGRET (*)()) ResetAlarm);
  51. X    (void) signal (SIGUSR2, (SIGRET (*)()) KillAlarm);
  52. }
  53. SHAR_EOF
  54. echo 'File xalarm.c is complete' &&
  55. chmod 0644 xalarm.c ||
  56. echo 'restore of xalarm.c failed'
  57. Wc_c="`wc -c < 'xalarm.c'`"
  58. test 10665 -eq "$Wc_c" ||
  59.     echo 'xalarm.c: original size 10665, current size' "$Wc_c"
  60. rm -f _shar_wnt_.tmp
  61. fi
  62. # ============= xalarm.h ==============
  63. if test -f 'xalarm.h' -a X"$1" != X"-c"; then
  64.     echo 'x - skipping xalarm.h (File already exists)'
  65.     rm -f _shar_wnt_.tmp
  66. else
  67. > _shar_wnt_.tmp
  68. echo 'x - extracting xalarm.h (Text)'
  69. sed 's/^X//' << 'SHAR_EOF' > 'xalarm.h' &&
  70. /*
  71. X      Copyright (c) 1991, 1992 by Simon Marshall, University of Hull, UK
  72. X
  73. X           If you still end up late, don't blame me!
  74. X                       
  75. X  Permission to use, copy, modify, distribute, and sell this software and its
  76. X       documentation for any purpose and without fee is hereby granted,
  77. X    provided that the above copyright notice appear in all copies and that
  78. X    both that copyright notice and this permission notice appear in
  79. X               supporting documentation.
  80. X                       
  81. X  This software is provided AS IS with no warranties of any kind.  The author
  82. X    shall have no liability with respect to the infringement of copyrights,
  83. X     trade secrets or any patents by this file or any part thereof.  In no
  84. X      event will the author be liable for any lost revenue or profits or
  85. X          other special, indirect and consequential damages.
  86. */
  87. X
  88. #ifndef xalarm_h
  89. #define xalarm_h
  90. X
  91. /* 
  92. X * Bits & bobs #defines, needed by most/all bits & bobs files.
  93. X */
  94. X
  95. #include <X11/Xos.h>
  96. #include <X11/Intrinsic.h>
  97. #include <X11/StringDefs.h>
  98. #include <X11/Shell.h>
  99. X
  100. #include <stdio.h>
  101. #include <ctype.h>
  102. #include <signal.h>
  103. X
  104. #include "patchlevel.h"
  105. X
  106. /* 
  107. X * Type of instantiation of xalarm.
  108. X */
  109. X
  110. typedef enum {
  111. X    Alarm, File, Daemon, RestartOnly
  112. } Instance;
  113. X
  114. /* 
  115. X * Application data - from the parsing of the command line args.
  116. X */
  117. X
  118. typedef struct {
  119. X    String    kill, reset, snooze, proggie, geometry, time, date, warnings, pester,
  120. X          warnaudio, alarmaudio;
  121. X    Boolean   confirm, list, quiet, version, help;
  122. X    int       warningwords, volume;
  123. } ApplData;
  124. X
  125. X
  126. /* 
  127. X * Global xalarm data, stuffed under one structure.
  128. X */
  129. X
  130. typedef struct {
  131. X    XtAppContext    appcon;
  132. X    XtIntervalId    timeoutid[100], whenid, warningid, alarmid, pesterid;
  133. X    Widget         toplevel, alarmwidget, messagewidget, snoozetimebutton,
  134. X            dialog, gettimewidget, getdatewidget, getwtimewidget, confirmwidget,
  135. X            warningwidget, savebutton;
  136. X    Boolean         confirm, saveonshutdown;
  137. X    String         proggie, geometry, messagestr, timestr, datestr, warningsstr,
  138. X            warningaudio, alarmaudio;
  139. X    char        errormessage[1024];
  140. X    unsigned long   dateout, warnings[100], settime, offtime;
  141. X    long        timeout;
  142. X    int         snooze, numwarnings, warningwords, pester, volume;
  143. } AlarmData;
  144. X
  145. /* 
  146. X * macro names...
  147. X */
  148. X
  149. #define        XtNtime        "time"
  150. #define        XtCTime        "Time"
  151. #define        XtNdate        "date"
  152. #define        XtCDate        "Date"
  153. #define        XtNwarnings    "warnings"
  154. #define        XtCWarnings    "Warnings"
  155. #define        XtNwarningwords    "warningwords"
  156. #define        XtCWarningwords "Warningwords"
  157. #define        XtNpester    "pester"
  158. #define        XtCPester    "Pester"
  159. #define        XtNsnooze    "snooze"
  160. #define        XtCSnooze    "Snooze"
  161. #define        XtNconfirm    "confirm"
  162. #define        XtCConfirm    "Confirm"
  163. #define        XtNreset    "reset"
  164. #define        XtCReset    "Reset"
  165. #define        XtNlist        "list"
  166. #define        XtCList        "List"
  167. #define        XtNkill        "kill"
  168. #define        XtCKill        "Kill"
  169. #define        XtNalarmaudio    "alarmaudio"
  170. #define        XtCAlarmaudio    "Alarmaudio"
  171. #define        XtNwarnaudio    "warningaudio"
  172. #define        XtCWarnaudio    "Warningaudio"
  173. #define        XtNquiet    "quiet"
  174. #define        XtCQuiet    "Quiet"
  175. #define        XtNvolume    "volume"
  176. #define        XtCVolume    "Volume"
  177. #define        XtNversion    "version"
  178. #define        XtCVersion    "Version"
  179. #define        XtNhelp        "help"
  180. #define        XtCHelp        "Help"
  181. X
  182. /* 
  183. X * A R4 problem, I think, not apparent in R5.
  184. X */
  185. X
  186. #ifndef XtNname
  187. #define        XtNname        "name"
  188. #endif
  189. #ifndef XtCName
  190. #define        XtCName        "Name"
  191. #endif
  192. X
  193. /* 
  194. X * This is cos of a bug of some sort spotted on a Sparc 2 (SunOS 4.1.1), X11r4,
  195. X * whereby X crashes if given a zero timeout.  Just woof it up a bit.
  196. X */
  197. X
  198. #if defined (SparcArchitecture)
  199. #define        TIMEOUT(t)    ((unsigned long) ((t) < 100 ? 100 : (t)))
  200. #else
  201. #define        TIMEOUT(t)    ((unsigned long) (t))
  202. #endif
  203. X
  204. /* 
  205. X * And the rest...
  206. X */
  207. X
  208. #define        CreateManagedButton(widget, name, parent, callback, clientdata) \
  209. X    widget = XtVaCreateManagedWidget (name, commandWidgetClass, parent, NULL); \
  210. X    XtAddCallback (widget, XtNcallback, (XtCallbackProc) callback, \
  211. X           (XtPointer) clientdata)
  212. X
  213. #define        AddValueCallback(widget, callback, clientdata) { \
  214. X    Widget   source; \
  215. X    XtVaGetValues (XtNameToWidget (widget, "value"), XtNtextSource, &source, NULL); \
  216. X    XtAddCallback (source, XtNcallback, (XtCallbackProc) callback, \
  217. X           (XtPointer) clientdata); \
  218. X    }
  219. X
  220. #if defined (SIGNALRETURNSINT)
  221. #define        SIGRET        int
  222. #else
  223. #define        SIGRET        void
  224. #endif
  225. X
  226. #if defined (FORKRETURNSSHORT)
  227. #define        FORKRET        short
  228. #elif defined (FORKRETURNSLONG)
  229. #define        FORKRET        long
  230. #elif defined (FORKRETURNSPID_T)
  231. #define        FORKRET        pid_t
  232. #else
  233. #define        FORKRET        int
  234. #endif
  235. X
  236. #define        or        ||
  237. #define        and        &&
  238. #define        not        !
  239. X
  240. #define        XALARMFILE    ".xalarms"
  241. #define        NOTKNOWN    "UNKNOWN"
  242. #define        NOGEOMETRY    "NOGEOM"
  243. #define        ALL        "all"
  244. #define        BELL        "bell"
  245. #define        BEEP        "beep"
  246. #define        QUIET        "quiet"
  247. #define        INVALID        (-1)
  248. #define        NONWIDGET    ((Widget) -1)
  249. #define        NONID        ((XtIntervalId) -1)
  250. #define        DAEMONWEEKLY    (INVALID-1)
  251. #define        TEXT        1024
  252. X
  253. #define        LEAPYEAR(y)    (((y) % 400 == 0) or \
  254. X                 (((y) % 4 == 0) and ((y) % 100 != 0)))
  255. #define        DAYSINFEB(y)    ((LEAPYEAR ((y))) ? 29 : 28)
  256. #define        DAYSINYEAR(y)    ((LEAPYEAR ((y))) ? 366 : 365)
  257. X
  258. #define        SECSIN1MIN    (60)
  259. #define        SECSIN1HR    (60*SECSIN1MIN)
  260. #define        SECSIN1DAY    (24*SECSIN1HR)
  261. X
  262. #define        MSECSIN1SEC    (1000)
  263. #define        MSECSIN1MIN    (60*MSECSIN1SEC)
  264. #define        MSECSIN1HR    (60*MSECSIN1MIN)
  265. #define        MSECSIN1DAY    (24*MSECSIN1HR)
  266. X
  267. #define        ISVALID(x)    ((x) != (INVALID))
  268. #define        ISINVALID(x)    ((x) == (INVALID))
  269. #define        ISWIDGET(x)    ((x) != (NONWIDGET))
  270. #define        ISNONWIDGET(x)    ((x) == (NONWIDGET))
  271. #define        ISID(x)        ((x) != (NONID))
  272. #define        ISNONID(x)    ((x) == (NONID))
  273. #define        ISWEEKLYD(x)    ((x) == (DAEMONWEEKLY))
  274. X
  275. #define        PLURAL(x)    ((((int) (x)) == 1) ? "" : "s")
  276. #define        ENDOF(str)    ((str) + strlen (str))
  277. X
  278. #define        SUMTIMEOUTS(a, b) \
  279. X    (unsigned long) (((b) < 0) ? (a) - (unsigned long) (-b) : (a) + (unsigned long) (b))
  280. X
  281. #define        MAX(x, y)    ((x) > (y) ? (x) : (y))
  282. #define        MIN(x, y)    ((x) < (y) ? (x) : (y))
  283. X
  284. #define        STREQUAL(a, b)    (strncmp ((a), (b), strlen (b)) == 0)
  285. #define        ERRORIS(error)    (STREQUAL (xalarm.errormessage, error))
  286. #define        NIL(type, x)    ((x) == (type) NULL)
  287. #define        NONNIL(type, x)    ((x) != (type) NULL)
  288. X
  289. #define        MAKETIMESTRING(buf, mins) \
  290. X                    if ((mins) >= 60) \
  291. X    (void) sprintf (buf, "%d:%02d hr%s", (int) (mins)/60, (int) (mins)%60, \
  292. X            PLURAL ((mins)/60)); \
  293. X                else \
  294. X    (void) sprintf (buf, "%d min%s", (int) (mins), PLURAL (mins))
  295. X
  296. #define        MAKETIME(buf, mins) \
  297. X                    if ((mins) >= 60) \
  298. X    (void) sprintf (buf, "%d:%02d", (int) (mins)/60, (int) (mins)%60); \
  299. X                else \
  300. X    (void) sprintf (buf, "%d", (int) (mins))
  301. X
  302. #define        RESETERROR()    xalarm.errormessage[0] = '\0'
  303. X
  304. #define        ADDERROR(message, madeto) \
  305. X    if (NIL (String, madeto)) \
  306. X    (void) sprintf (xalarm.errormessage, "%s\n", message); \
  307. X    else if (*madeto == '\0') \
  308. X    (void) sprintf (xalarm.errormessage, "%s  (at end)\n", message); \
  309. X    else \
  310. X    (void) sprintf (xalarm.errormessage, "%s  (at `%s')\n", message, madeto)
  311. X
  312. /*
  313. X * DON'T PUT ANYTHING AFTER THIS!!!
  314. X */
  315. #endif
  316. SHAR_EOF
  317. chmod 0644 xalarm.h ||
  318. echo 'restore of xalarm.h failed'
  319. Wc_c="`wc -c < 'xalarm.h'`"
  320. test 6981 -eq "$Wc_c" ||
  321.     echo 'xalarm.h: original size 6981, current size' "$Wc_c"
  322. rm -f _shar_wnt_.tmp
  323. fi
  324. # ============= xalarm.man ==============
  325. if test -f 'xalarm.man' -a X"$1" != X"-c"; then
  326.     echo 'x - skipping xalarm.man (File already exists)'
  327.     rm -f _shar_wnt_.tmp
  328. else
  329. > _shar_wnt_.tmp
  330. echo 'x - extracting xalarm.man (Text)'
  331. sed 's/^X//' << 'SHAR_EOF' > 'xalarm.man' &&
  332. .TH XALARM 1 "Release 5" "X Version 11"
  333. .SH "NAME"
  334. xalarm - alarm clock for
  335. .I X
  336. .LP
  337. xmemo - memo for
  338. .I X
  339. .LP
  340. xfortune - fortune for
  341. .I X
  342. .LP
  343. xyow - yow for
  344. .I X
  345. .SH "SYNOPSIS"
  346. .B xalarm
  347. [-\fItoolkitoption\fP ...] [-option ...] [message_text]
  348. .LP
  349. .B xmemo
  350. [-\fItoolkitoption\fP ...] [-option ...] [message_text]
  351. .LP
  352. .B xfortune
  353. [-\fItoolkitoption\fP ...] [-option ...]
  354. .LP
  355. .B xyow
  356. [-\fItoolkitoption\fP ...] [-option ...]
  357. .SH "DESCRIPTION"
  358. .I xalarm 
  359. is an interactive alarm clock for the
  360. .I X(1) Window System,
  361. and is analogous to a combination of
  362. .I leave(1)
  363. and
  364. .I calendar(1),
  365. but much more powerful.  You can set the alarm either on the command line
  366. or by using the popup window.  At the appropriate time and date,
  367. .I xalarm
  368. pops up a window to tell you that your time is up.  The time the alarm is to
  369. trigger may be a specific time or a time for
  370. .I xalarm
  371. to wait before triggering.  The date may be a specific date or a number of days
  372. in the future.
  373. X
  374. You can tell 
  375. .I xalarm
  376. to pop up warning windows at specified times before the alarm is to trigger,
  377. in order to warn you of the impending triggering of the alarm, and specify
  378. what message you want the alarm to display.
  379. X
  380. You can also make
  381. .I xalarm
  382. read alarm times and dates, along with the message to display in the alarm,
  383. from alarm files.  This can be done once by
  384. .I xalarm,
  385. or you can make it read from the file periodically, as an
  386. .I xalarm
  387. daemon.  This enables you to forget your regular or important appointments, but
  388. .I xalarm
  389. will tell you by popping up at the appropriate time.
  390. X
  391. In the event that the current
  392. .I X
  393. session is terminated before
  394. .I xalarm
  395. has finished,
  396. .I xalarm
  397. saves its alarm (if it is not already in the alarm file) so that it will
  398. automatically be restarted the next time
  399. .I xalarm
  400. is invoked.  Any daemons connected to the display will go away.
  401. X
  402. This means that you can set an alarm even if you are likely to terminate the
  403. .I X
  404. session underwhich you are currently running before it triggers, and the alarm
  405. will still trigger on whatever display you are then connected to at the time.
  406. X
  407. The alarm window itself consists of a box of buttons and an area containing
  408. the alarm message.  To give you an opportunity to carry on after the alarm has
  409. triggered and be late anyway,
  410. .I xalarm
  411. allows you to snooze the alarm.  For the completely absent-minded,
  412. .I xalarm
  413. can also repeatedly re-trigger after a specified interval.
  414. X
  415. To help with setting the alarm, each popup displays the current time, and the
  416. alarm itself also displays the time since the alarm last triggered.
  417. .SH "USING XALARM TO SET AN ALARM"
  418. If no alarm time is specified,
  419. .I xalarm
  420. will pop up a window in order for an alarm time to be entered.
  421. X
  422. This form is suitable for inclusion as a menu option under a window manager.
  423. X
  424. The window is also popped up if an invalid alarm or warning time is given
  425. (see below for date and time syntax), or if you specify that confirmation
  426. should be sought before setting the alarm.
  427. X
  428. The window gives you an opportunity to change the alarm setting, warning times,
  429. and the message
  430. .I xalarm
  431. will display when the alarm is triggered.
  432. X
  433. The popup resizes itself to
  434. edit any message larger than the space given by default.  The keymap used by
  435. the Athena Dialog widget is modelled on the text buffer keymap of the
  436. editor/environment
  437. .I emacs(1).
  438. Text may be entered when the pointer is anywhere within the popup.
  439. X
  440. This popup window comprises of four separate windows, dealing with the alarm
  441. time, date, the warning time(s) and confirmation of all the settings (where you
  442. can also re-edit the alarm message).
  443. X
  444. If the confirmation window is popped up, then you can re-edit the alarm time,
  445. date, or warning time(s) by switching through the windows using the
  446. .I edit
  447. buttons.  Confirmation of a window's settings is made using the
  448. .I enter
  449. buttons, and the translations resource is set so that the
  450. .I return
  451. key will do the same thing.
  452. X
  453. XFrom the confirmation window you can also save the alarm settings in your own
  454. alarm file.  You can make
  455. .I xalarm
  456. read alarms from this alarm file.
  457. X
  458. If confirmation is not enabled, then the window for confirmation of all
  459. settings will not be popped up even if the other windows are.
  460. X
  461. Also see the examples section.
  462. .SH "USING XALARM TO READ AN ALARM FILE"
  463. You can put alarms in alarm files.
  464. .I xalarm
  465. looks in
  466. .I ~/.xalarms
  467. and all the files in the colon separated list of files in the environment
  468. variable
  469. .I XALARMFILEPATH.
  470. X
  471. This form is suitable for
  472. inclusion in your
  473. .I X
  474. start up or initialisation  script.  It is suited to those who start up
  475. .I X
  476. on a regular (eg. daily) basis.
  477. X
  478. Each line in the file should consist of an optional date on which the alarm is
  479. to trigger, optionally followed the by time and/or message.  If the time and/or
  480. date are/is specified, then they must be separated from the date by a `-' on
  481. its own.  If both the time and message are given, the time must come first.
  482. X
  483. If no date is specified, it is assumed to be today.  If no time is specified,
  484. the alarm will trigger at the current time on whatever date is given.
  485. X
  486. The format for entries in an alarm file is therefore:
  487. .PP
  488. .nf
  489. X                \fIdate [- [time] [message]]\fP
  490. X    or
  491. X                \fI      - [time] [message]\fP
  492. .fi
  493. X
  494. To make it easier to put entries into the alarm file,
  495. .I xalarm
  496. can create them for you.  You can save settings by pressing the
  497. .I save
  498. button in the confirmation window when you have set the alarm that you want.
  499. The settings are saved in the alarm file
  500. .I ~/.xalarms.
  501. X
  502. You can use
  503. .I XALARMFILEPATH
  504. to include alarms shared among a number of people.  If a path in the list is
  505. not absolute, then it is assumed to be relative to your home directory.
  506. X
  507. Blank lines and any line with `#' or `!' as the first character are ignored.
  508. This can be used to structure and comment the alarm file.
  509. X
  510. All other command line options and resources still apply.  See below for the
  511. date and time formats.  Also see the examples section.
  512. .SH "USING A DAEMON TO READ AN ALARM FILE"
  513. An alternative to using the file option to search for alarms within a certain
  514. date, is to use an
  515. .I xalarm
  516. daemon.
  517. X
  518. This form is suitable for
  519. inclusion in your
  520. .I X
  521. start up or initialisation  script.  It is suited to those whose
  522. .I X
  523. sessions typically span days.
  524. X
  525. The daemon behaves in the same way as invoking
  526. .I xalarm
  527. with the file option, except that it periodically attempts to scan the alarm
  528. file(s).  The interval between scanning may be a date in the form of
  529. .I +days,
  530. or one of the special symbols
  531. .I daily
  532. (equivalent to
  533. .I +1)
  534. or
  535. .I weekly.
  536. See below for more on date formats.
  537. X
  538. Once started, the daemon immediately reads the alarm file(s), starting those
  539. alarms which are within the date given.  It then sleeps until the number of
  540. days given ahead (on the following Sunday if given as
  541. .I weekly)
  542. at just passed midnight before trying again, ad infinitum.  The daemon dies
  543. when the connection to the display is lost.
  544. X
  545. Note that any
  546. .I xalarm
  547. processes that the daemon invokes will try to connect to the same display each
  548. time.  If you move displays,
  549. .I xalarm
  550. cannot know.
  551. X
  552. Also see the examples section.
  553. .SH "TIMES"
  554. The definition is that for times given with 3 or 4 digits, the last 2 digits
  555. are always assumed to be minutes.
  556. X
  557. Absolute times may be suffixed with `am' or `pm', and are assumed to be in
  558. hours if given with 1 or 2 digits.
  559. X
  560. Times relative to the present time must be prefixed by `+', and are assumed to
  561. be in minutes if given with 1 or 2 digits.
  562. X
  563. The special symbols
  564. .I now
  565. and
  566. .I noon
  567. may also be used, and are equivalent to
  568. .I +0
  569. and
  570. .I 12:00,
  571. respectively.  Hours and minutes may be separated with `:', `.' or `-'.
  572. X
  573. To prevent ambiguities, hours and minutes must be in their usual ranges.  If a
  574. time of an hour or more is wanted, you must state it in hours and minutes.  It
  575. is not possible to specify days in the time.
  576. X
  577. The format is a super-set (by far) of the format recognised by
  578. .I leave(1).
  579. X
  580. Also see the examples section.
  581. .SH "DATES"
  582. The date may be in the form of that given by
  583. .I date(1)
  584. (day of week, day of month, month, year), but can be in any order, need not be
  585. completely specified, and case is not significant.
  586. .I xalarm
  587. attempts to find the nearest real date which matches the date given.
  588. X
  589. Alternatively, the date may be specified as the number of whole days into the
  590. future, by prefixing the number with `+'.  The special symbols
  591. .I today, tomorrow
  592. and
  593. .I week
  594. may also be used, and these symbols may be combined.  They are equivalent to
  595. .I +0, +1
  596. and
  597. .I +7,
  598. respectively.
  599. X
  600. Note that if there is more than one word in the date, then the date must be
  601. quoted to stop the shell treating them as separate arguments.
  602. X
  603. When given as an argument to the
  604. .I -date
  605. option,
  606. .I week
  607. means ``seven days into the future''.  However, when it is used as an argument
  608. to the
  609. .I -file
  610. or
  611. .I -daemon
  612. options, it means ``until the end of the current week'' (up to and including
  613. the coming Sunday), as in
  614. .I weekly.
  615. This is to make it easier to get
  616. .I xalarm
  617. to set all the alarms for the current week.
  618. X
  619. Because the alarm is set in milliseconds, you cannot set an alarm for more than
  620. 49 days into the future (on the assumption that your machine has 32-bit
  621. unsigned longs).
  622. X
  623. All symbols must consist of at least the first 3 characters of the name.
  624. Unlike
  625. .I calendar(1), tomorrow
  626. always means tomorrow.
  627. X
  628. Also see the examples section.
  629. .SH "WARNINGS"
  630. When given, warnings are popped up at specified times before the alarm.  You
  631. can also specify that a number of words from the alarm message should be
  632. displayed with any warnings, in case you've forgotten what you set it for.  If
  633. none are to be used, the warning will only indicate when the alarm is due.
  634. X
  635. Also see the examples section.
  636. .SH "RINGING"
  637. You can specify how
  638. .I xalarm
  639. announces itself, when either a warning or the alarm is popped up.  Each of
  640. these events has a separate resource, which can be one of the special symbols
  641. .I bell, beep
  642. and
  643. .I quiet,
  644. or a shell script.
  645. X
  646. The first two cause the terminal bell to be rung, and
  647. .I quiet
  648. does nothing.  Otherwise it is assumed to be a shell script and is executed
  649. under a Bourne shell
  650. .I (sh(1)).
  651. You can also control the volume at which the terminal bell is rung.
  652. X
  653. Note that if the script contains more than one word then the whole script must
  654. be quoted to stop the shell treating them as separate arguments.
  655. X
  656. Also see the examples section.
  657. .SH "SNOOZING AND PESTERING"
  658. You can snooze the alarm and make it pester you, after the alarm has triggered.
  659. X
  660. Snoozing is done by selecting a time to snooze using the
  661. .I +mins
  662. buttons (they can be pressed as often as necessary) and pressing the 
  663. .I snooze
  664. button.  The snooze time may be zeroed by clicking on the
  665. .I snoozetime
  666. button (it has these two functions; display and zero).  For the really lazy,
  667. the initial value of
  668. .I snoozetime
  669. can be set either by the relevant command line option or by its resource.
  670. X
  671. Pestering is done either by the relevant command line option or by its
  672. resource.  The alarm will then re-popup after the specified interval, a bit
  673. like
  674. .I snooze
  675. on autopilot.
  676. X
  677. Note that if you snooze the alarm, pestering is temporarily disabled and you
  678. will have to rely on the snoozed alarm.
  679. X
  680. Also see the examples section.
  681. .SH "MORE ON XALARM"
  682. Even after you have set the alarm and confirmed it, you can reset the alarm
  683. as long as you know the
  684. .I xalarm
  685. process number.  This can be found by using the
  686. command line option to list process numbers, or
  687. .I ps(1).
  688. X
  689. .I xalarm
  690. makes maximum use of resources, as well as having a number of command
  691. line options, and these can be used to control most of the appearance of
  692. .I xalarm
  693. and (just about) all of its behaviour.  Both command line options and useful
  694. resources are listed below.
  695. X
  696. When
  697. .I xalarm
  698. is invoked it immediately attempts to fork off a child and exit itself, leaving
  699. the child to continue with the alarm.  The child disappears when the
  700. .I X
  701. session on which display 
  702. .I xalarm
  703. is using is terminated.
  704. X
  705. You can exit from
  706. .I xalarm
  707. at any time by pressing the available
  708. .I quit
  709. button.
  710. .SH "XMEMO, XFORTUNE & XYOW"
  711. X
  712. In reality,
  713. .I xmemo
  714. is just a front end to
  715. .I xalarm
  716. (implemented as
  717. .I xalarm -time now -date today),
  718. while
  719. .I xfortune
  720. and
  721. .I xyow
  722. are front ends to
  723. .I xmemo
  724. (implemented as
  725. .I xmemo \fI"\fP`fortune`\fI"\fP
  726. etc.).
  727. Options supplied to them on the command line still override these defaults,
  728. however.
  729. .PP
  730. Note that
  731. .I xfortune
  732. and
  733. .I xyow
  734. require
  735. .I fortune(6)
  736. and
  737. .I yow(6)
  738. respectively -
  739. .I yow(6)
  740. comes with
  741. .I emacs(1).
  742. Also note that since they are front ends to
  743. .I xmemo,
  744. you can actually give extra message text to include on the command line.  If
  745. you specify a time in the future, you can edit the message text when asked to
  746. confirm (if enabled).
  747. .SH "OPTIONS"
  748. .I xalarm
  749. accepts all of the standard
  750. .I X
  751. Toolkit command line options along with the additional options listed below:
  752. .TP 8
  753. .B \-help
  754. Print a (possibly) helpful usage message.
  755. .TP 8
  756. .B \-version
  757. Print out the version number of
  758. .I xalarm
  759. in the form
  760. .I version.patchlevel.
  761. .TP 8
  762. .B -restart[only]
  763. This option makes
  764. .I xalarm
  765. attempt only to restart those alarms which had not finished when a previous
  766. .I X
  767. session was terminated.
  768. .TP 8
  769. .B \-kill \fIpid|all\fP
  770. This option sends a signal to the process number
  771. .I pid,
  772. or to all
  773. .I xalarm
  774. processes, on the current host.  If the process is an
  775. .I xalarm,
  776. owned by you, it will exit.  Note these are what
  777. .I ps(1)
  778. thinks are
  779. .I xalarm
  780. processes, and only on the current host.
  781. .TP 8
  782. .B \-d[a]emon \fI+days|daily|weekly\fP
  783. This option starts a new
  784. .I xalarm
  785. daemon on the current host connected to the current display.  See the above
  786. description for more on alarm files, dates and daemons.
  787. .TP 8
  788. .B \-f[ile] \fI+days|date|today|tomorrow|weekly\fP
  789. This option makes
  790. .I xalarm
  791. read alarms from the alarm file(s).  See the above description for more on the
  792. alarm file and dates.
  793. .TP 8
  794. .B \-date \fI+days|date|today|tomorrow|week\fP
  795. This option indicates the date on which the alarm is to be triggered.  See the
  796. above description for more on dates.
  797. .TP 8
  798. .B \-t[ime] \fI+time|time|now|noon\fP
  799. This option indicates at what time the alarm is to be triggered.  See the above
  800. description for more on times.
  801. .TP 8
  802. .B \-w[arn] \fItime[,time...]\fP
  803. Indicate the time(s) before the alarm is due to trigger when a warning should
  804. be given.  They need not be in any particular order, and should be in the same
  805. format as relative times, but without the preceding `+'.  Note that multiple
  806. times must be separated by commas but without spaces.
  807. .TP 8
  808. .B \-c[onfirm]
  809. This option overrides the resource value and forces
  810. .I xalarm
  811. to ask for confirmation, unless the alarm is due to trigger immediately.
  812. .TP 8
  813. .B \-warnwords [\-ww] \fInumber_of_words\fP
  814. Indicate the number of words from the alarm message you wish to display with
  815. the warning.
  816. .TP 8
  817. .B \-l[ist]
  818. List the process numbers of any
  819. .I xalarm
  820. processes running on the current host.  Note that this lists what
  821. .I ps(1)
  822. thinks are
  823. .I xalarm
  824. processes, and only on the current host.
  825. .TP 8
  826. .B \-r[eset] \fIpid|all\fP
  827. This option sends a signal to the process number
  828. .I pid,
  829. or to all
  830. .I xalarm
  831. processes, on the current host.  If the process is an
  832. .I xalarm,
  833. owned by you, it will pop up the confirmation window to allow you to re-edit
  834. the alarm settings.  If the process is an
  835. .I xalarm
  836. daemon, it will have no effect.  Note these are what
  837. .I ps(1)
  838. thinks are
  839. .I xalarm
  840. processes, and only on the current host.
  841. .TP 8
  842. .B \-p[ester] \fItime\fP
  843. Indicate the time that
  844. .I xalarm
  845. should wait before re-triggering.  It should be in the same format as relative
  846. times, but without the preceding `+'.
  847. .TP 8
  848. .B \-s[nooze] \fItime\fP
  849. Indicate the time that
  850. .I snoozetime
  851. should initially have when the alarm triggers.  It should be in the same format
  852. as relative times, but without the preceding `+'.
  853. .TP 8
  854. .B \-alarmaudio [\-aa] \fIbell|beep|quiet|shell script\fP
  855. The method by which
  856. .I xalarm
  857. should announce the fact that the alarm has been triggered.  See above for a
  858. description on the different options.
  859. .TP 8
  860. .B \-warningaudio [\-wa] \fIbell|beep|quiet|shell script\fP
  861. As above, but for when any warning windows are popped up.
  862. .TP 8
  863. .B \-q[uiet]
  864. This is equivalent to specifying
  865. .I -alarmaudio quiet -warningaudio quiet,
  866. or setting the relevant resources to
  867. .I quiet.
  868. .TP 8
  869. .B \-v[olume] \fIpercentage\fP
  870. The percentage of full volume at which the terminal bell should ring, if it is
  871. rung.  This currently applies to the terminal bell only.
  872. .TP 8
  873. .B \-nowarn [\-nw]
  874. This option overrides the resource value and forces
  875. .I xalarm
  876. not to give any warnings.  This is the same as setting the warning times
  877. resource to the empty string.
  878. .TP 8
  879. .B \-noconfirm [\-nc]
  880. This option overrides the resource value and forces
  881. .I xalarm
  882. not to ask for confirmation.
  883. .TP 8
  884. .B \-nowarnwords [\-nww]
  885. This option overrides the resource value and forces
  886. .I xalarm
  887. not to display any of the alarm text with any warnings.  This is the same
  888. as setting the warningwords resource to zero.
  889. .TP 8
  890. .B \-nopester [\-np]
  891. This option overrides the resource value and forces
  892. .I xalarm
  893. not to re-trigger the alarm once it has popped up.  This is the same as setting
  894. the pester resource to zero.
  895. .TP 8
  896. .B \-noalarmaudio [\-naa] \-nowarningaudio [\-nwa]
  897. These options make the relevant resource values
  898. .I quiet,
  899. and are equivalent to setting the audio method to
  900. .I quiet.
  901. .TP 8
  902. .B \fImessage_text\fP
  903. The remaining unrecognised text is used as the message displayed with the
  904. triggering of the alarm.  Note that each separate argument is assumed to be a
  905. single line, so words must be quoted if they are to appear on the same line.
  906. For example:
  907. .TP 8
  908. X            % \fBxalarm "On one line" Secondline "Third line"\fP
  909. X
  910. It is a good idea always to use quotes, even when a line is only one word.
  911. Newlines within arguments are recognised, so that input from other tools can be
  912. used:
  913. .TP 8
  914. X            % \fBxalarm -time now "`fortune -l`"\fP
  915. X
  916. Also note that 
  917. .I xalarm
  918. deletes its copy of any arguments, including any message, given on the command
  919. line, so your boss can't see them by looking at the
  920. .I xalarm
  921. process.
  922. .SH "EXAMPLES"
  923. An entry in an
  924. .I X
  925. initialisation file, invoked along with all the other utilities, before the
  926. window manager is executed, making
  927. .I xalarm
  928. check the alarm file for today's appointments, asking for confirmation before
  929. each of the alarms are set, and using up to three words from the alarm message
  930. in any warning message:
  931. .PP
  932. .nf
  933. X    xclock &
  934. X    xbiff &
  935. X    xalarm -file today -confirm -warnwords 3
  936. X    exec twm
  937. .fi
  938. X
  939. If you do not want to know about the alarms that remain from the previous
  940. .I X
  941. session, you could first restart them silently.  Here they are restarted with
  942. warnings set at 15 and 30 minutes prior to each alarm's triggering.
  943. X
  944. To check the week's appointments, including some shared alarm files, warning 1
  945. hour, and 30 and 15 minutes before each alarm (if you set the variable in your
  946. .I X
  947. initialisation script, rather than your login script, you may need to export
  948. it):
  949. .PP
  950. .nf
  951. X    XALARMFILEPATH=\\
  952. X        /usr/local/lib/seminars.xlm:/usr/local/lib/meetings.xlm
  953. X    export XALARMFILEPATH
  954. X    xalarm -restartonly -noconfirm -warn 15,30
  955. X    xalarm -file weekly -confirm -warn 1:00,30,15
  956. .fi
  957. X
  958. Or to start an
  959. .I xalarm
  960. daemon, which is to scan the alarm file on a daily basis.  Each alarm should
  961. not ask for confirmation, but should give warnings 30 and 15 minutes before
  962. triggering, and pester every 5 minutes thereafter:
  963. .PP
  964. .nf
  965. X    xalarm -daemon daily -noconfirm -warn 15,30 -pester 5
  966. .fi
  967. X
  968. The alarm file might contain, for example, the lines:
  969. X
  970. .nf
  971. X    # This is just a comment.
  972. X    ! So is this.  Format is: \fIdate [- [time] [message]]\fP
  973. X    !                     or: \fI      - [time] [message]\fP
  974. X
  975. X    Wednesday - 12:30pm Football !!!
  976. X    Sun 29 september - 9pm Drag yourself home.
  977. X    Oct 4 - Contrib sometime today...
  978. .fi
  979. X
  980. So that every Wednesday I have an alarm set for 12:30pm; on Sunday September 29
  981. there is an alarm to be set for 9pm; on October 4 the alarm is to trigger
  982. straight away.
  983. .PP
  984. A
  985. .I twm(1)
  986. window manger entry which forces
  987. .I xalarm
  988. to ask for confirmation, and have the triggered alarm re-trigger every 5
  989. minutes:
  990. .PP
  991. .nf
  992. X    Menu "Utilities" {
  993. X        ...
  994. X        "alarm":    f.exec "xalarm -confirm -pester 5 &"
  995. X        ...
  996. X    }
  997. .fi
  998. .PP
  999. X
  1000. The following examples show how to set the alarm from the command line.  It is
  1001. often more convenient to invoke
  1002. .I xalarm
  1003. without specifying the time and, where necessary, the date and/or message as
  1004. arguments (using a window manager, say, as above), using the popup window to
  1005. enter these options.
  1006. X
  1007. If this was the method of entry, the option arguments would be entered in the
  1008. relevant Dialog box instead, just as they appear below (except that there is no
  1009. need to quote multi-word arguments).
  1010. X
  1011. To only restart those
  1012. .I xalarm
  1013. processes that were set before a previous
  1014. .I X
  1015. session was terminated, not including those in the alarm file:
  1016. .TP 8
  1017. X    % \fBxalarm -restartonly\fR
  1018. .PP
  1019. To set an alarm for tomorrow at noon, so as to avoid missing yet another
  1020. meeting:
  1021. .TP 8
  1022. X    % \fBxalarm -date tomorrow -time noon "MEETING!!!"\fR
  1023. .PP
  1024. To set an alarm on Tuesday week (that is one week on from the next Tuesday) at
  1025. 3:30 in the afternoon:
  1026. .TP 8
  1027. X    % \fBxalarm -date "Tues week" -time 3-30pm\fR
  1028. .PP
  1029. To set an alarm for March 10th (my very own personal public holiday),
  1030. first thing in the morning, just in case I have forgotten:
  1031. .TP 8
  1032. X    % \fBxalarm -date "10 march" -time 9am "Birthday boy!"\fR
  1033. .PP
  1034. To set an alarm for 5 o'clock in the evening without confirmation, with the
  1035. snooze time initially 10 minutes, but with the default alarm message:
  1036. .TP 8
  1037. X    % \fBxalarm -time 5pm -snooze 10 -noconfirm\fR
  1038. .PP
  1039. To set an alarm for 2 hours in advance, warning 1 minute and 5 minutes before it,
  1040. with a message other than the default:
  1041. .TP 8
  1042. X    % \fBxalarm -time +2.00 -warn 5,1 "Get off your bottom"\fR
  1043. .PP
  1044. To set a completely silent alarm for 4.30 (not specifying am/pm, so it is
  1045. whichever is first), with the default warnings and a message other than the
  1046. default:
  1047. .TP 8
  1048. X    % \fBxalarm -quiet -time 4:30 "Time to sneak off home!"\fR
  1049. .PP
  1050. To reset a running
  1051. .I xalarm
  1052. we first find out its process number, and then we can reset it:
  1053. .nf
  1054. X
  1055. X    % \fBxalarm -list\fR
  1056. X    xalarms: 12345 12321
  1057. X    % \fBxalarm -reset 12345\fR
  1058. X
  1059. .fi
  1060. To put a 2 line message on the display
  1061. .I foo
  1062. immediately (this will only work if the display
  1063. .I foo
  1064. can be opened):
  1065. .TP 8
  1066. X    % \fBxmemo -display foo:0.0 "Bob!" "The bar for lunch?"\fR
  1067. .PP
  1068. To display a fortune (a random adage from hell) at a specific geometry in 5
  1069. minutes:
  1070. .TP 8
  1071. X    % \fBxfortune -geometry +10+300 -time +5\fR
  1072. .PP
  1073. To display a Zippy quote (yow!!!), characteristically harassing you every
  1074. minute and making some noise each time it triggers by executing a shell script:
  1075. .TP 8
  1076. X    % \fBxyow -pester 1 -alarmaudio "play -v30 yow.au"\fR
  1077. .PP
  1078. In this example,
  1079. .I -v30
  1080. is the option to make
  1081. .I play
  1082. play the audio data in the file
  1083. .I yow.au
  1084. at maximum volume.
  1085. .SH "WIDGET HIERARCHY"
  1086. .PP
  1087. .I xalarm
  1088. uses the Athena Widget set, and the widget hierarchy is as follows:
  1089. .PP
  1090. .nf
  1091. X    XAlarm (applicationShell)
  1092. X        Alarm! (transientShell)
  1093. X            alarm (form)
  1094. X                buttons (form)
  1095. X                    quit (command)
  1096. X                    snooze (command)
  1097. X                    snooze1 (command)
  1098. X                    snooze5 (command)
  1099. X                    snooze15 (command)
  1100. X                    snoozetime (command)
  1101. X                message (label)
  1102. X        When? (transientShell)
  1103. X            when (form)
  1104. X                time (dialog)
  1105. X                    label (label)
  1106. X                    value (asciiText)
  1107. X                    ok (command)
  1108. X                    editdate (command)
  1109. X                    editwarnings (command)
  1110. X                    quit (command)
  1111. X                date (dialog)
  1112. X                    label (label)
  1113. X                    value (asciiText)
  1114. X                    ok (command)
  1115. X                    edittime (command)
  1116. X                    editwarnings (command)
  1117. X                    quit (command)
  1118. X                warnings (dialog)
  1119. X                    label (label)
  1120. X                    value (asciiText)
  1121. X                    ok (command)
  1122. X                    edittime (command)
  1123. X                    editdate (command)
  1124. X                    quit (command)
  1125. X                confirm (dialog)
  1126. X                    label (label)
  1127. X                    value (asciiText)
  1128. X                    ok (command)
  1129. X                    cancel (command)
  1130. X                    save (command)
  1131. X                    quit (command)
  1132. X        Warning! (transientShell)
  1133. X            warning (form)
  1134. X                dismiss (command)
  1135. X                message (label)
  1136. X                reset (command)
  1137. X                quit (command)
  1138. .fi
  1139. .SH "EXAMPLE RESOURCES"
  1140. .PP
  1141. Some example resources.  These are the most common resources, and the ones most
  1142. likely needed changed in order to alter the (default) behaviour of
  1143. .I xalarm:
  1144. .PP
  1145. .nf
  1146. X    ! For some nice colours...
  1147. X    XAlarm*background:            LightYellow
  1148. X    XAlarm*foreground:            IndianRed
  1149. X    XAlarm*Command.background:        IndianRed
  1150. X    XAlarm*Command.foreground:        LightYellow
  1151. X    ! But this is what you normally get...
  1152. X    XAlarm*background:            White
  1153. X    XAlarm*foreground:            Black
  1154. X    XAlarm*Command.background:        Black
  1155. X    XAlarm*Command.foreground:        White
  1156. X
  1157. X    ! Perhaps the most commonly used resources...
  1158. X    XAlarm.confirm:                True
  1159. X    XAlarm.warnings:            5,15
  1160. X    XAlarm.warningwords:            0
  1161. X    XAlarm.pester:                0
  1162. X    XAlarm.snooze:                0
  1163. X    XAlarm.volume:                50
  1164. X    XAlarm.alarmaudio:            bell
  1165. X    XAlarm.warningaudio:            bell
  1166. X
  1167. X    ! If the fonts are not to your taste, try "-new century schoolbook-"
  1168. X    ! instead of "-times-".
  1169. X    XAlarm*font: -*-times-bold-r-*-*-14-*-*-*-p-*-iso8859-1
  1170. X    XAlarm.When?.when.confirm.value*font: -*-times-bold-i-*-*-14-*-*-*-p-*-iso8859-1
  1171. X    XAlarm.Alarm!.alarm.message.font: -*-times-bold-i-*-*-34-*-*-*-p-*-iso8859-1
  1172. X
  1173. X    ! If you want a more compact alarm window, try these...
  1174. X    XAlarm.Alarm!.alarm.buttons.snooze1.fromVert:    quit
  1175. X    ! This will vary depending on button labels & font...
  1176. X    XAlarm.Alarm!.alarm.buttons.snooze1.horizDistance:    -93
  1177. X    XAlarm.Alarm!.alarm.buttons.snooze5.fromVert:    quit
  1178. X    XAlarm.Alarm!.alarm.buttons.snooze15.fromVert:    quit
  1179. X    XAlarm.Alarm!.alarm.buttons.snoozetime.fromHoriz:    snooze
  1180. X
  1181. X    ! Plus, if you want...
  1182. X    XAlarm.Alarm!.alarm.message.fromHoriz:        buttons
  1183. X    ! This will vary depending on button labels & font...
  1184. X    XAlarm.Alarm!.alarm.message.vertDistance:        -33
  1185. X
  1186. X    ! Some other defaults...
  1187. X    XAlarm.Alarm!.alarm.background:        Black
  1188. X    XAlarm.Alarm!.alarm.message.label:        Alarm Call!!!
  1189. X    XAlarm.Alarm!.alarm.buttons.quit.label:    Quit
  1190. X    XAlarm.Alarm!.alarm.buttons.snooze.label:    Snooze
  1191. X    XAlarm.Alarm!.alarm.buttons.snooze1.label:    +1 min
  1192. X    XAlarm.Alarm!.alarm.buttons.snooze5.label:    +5 mins
  1193. X    XAlarm.Alarm!.alarm.buttons.snooze15.label:    +15 mins
  1194. .fi
  1195. .SH "TOOLKIT OPTIONS"
  1196. The following standard
  1197. .I X
  1198. Toolkit command line arguments are commonly used with 
  1199. .I xalarm:
  1200. .TP 8
  1201. .B \-display \fIdisplay\fP
  1202. This option specifies the
  1203. .I X
  1204. server to contact.
  1205. .TP 8
  1206. .B \-geometry \fIgeometry\fP
  1207. This option specifies the preferred size and position of
  1208. .I xalarm.
  1209. It is a little meaningless to specify a size; it is as large as need be.
  1210. .TP 8
  1211. .B \-xrm \fIresourcestring\fP
  1212. This option specifies a resource string to be used.  This is especially
  1213. useful for setting resources that do not have separate command line options.
  1214. .SH "ENVIRONMENT"
  1215. .TP 8
  1216. .B DISPLAY
  1217. to get the default host and display number.
  1218. .TP 8
  1219. .B XENVIRONMENT
  1220. to get the name of a resource file that overrides the global resources
  1221. stored in the RESOURCE_MANAGER property.
  1222. .TP 8
  1223. .B XALARMFILEPATH
  1224. a colon separated list of file names to be used in conjunction with
  1225. .I ~/.xalarms
  1226. for
  1227. .I xalarm
  1228. to look for alarms to set.
  1229. .TP 8
  1230. .B HOME
  1231. The user's home directory.  This may be used by
  1232. .I xalarm
  1233. when looking for the user's alarm file.
  1234. .SH "FILES"
  1235. .TP 8
  1236. .B ~/.xalarms
  1237. The name of the alarm file looked at by
  1238. .I xalarm 
  1239. for alarms to set and where alarms are saved.  See also the environment
  1240. variable
  1241. .I XALARMFILEPATH.
  1242. .TP 8
  1243. .B ~/.xalarms.died
  1244. The name of the alarm file where
  1245. .I xalarm
  1246. stores its alarm which had not finished when the
  1247. .I X
  1248. session under which it was running was terminated.
  1249. .SH "SEE ALSO"
  1250. XX(1),
  1251. leave(1),
  1252. calendar(1),
  1253. date(1),
  1254. emacs(1),
  1255. twm(1),
  1256. ps(1),
  1257. sh(1),
  1258. fortune(6),
  1259. yow(6)
  1260. .SH "BUGS"
  1261. .TP 8
  1262. .B Preamble:
  1263. Because of the way
  1264. .I xalarm
  1265. has evolved (it started as a 24-hour period one-off alarm clock), its dealing
  1266. with dates, alarm files and the interface to these is not ideal.  Nobody said
  1267. evolution was perfect.
  1268. X
  1269. If you want to report a bug, or anything else, please first give as much
  1270. information as you can.  See
  1271. .I COMMENTS
  1272. at the end of the manual.
  1273. .TP 8
  1274. .B General:
  1275. Each alarm is a separate, forked,
  1276. .I xalarm
  1277. process, each with its own connection to the display.  There is no way to get
  1278. .I xalarm
  1279. to set more than one alarm or to display on several displays at once.
  1280. X
  1281. Because
  1282. .I xalarm
  1283. is one of those clients you tend to start from a window manager or from an
  1284. .I X
  1285. initialisation script, you may not see error messages that these
  1286. .I xalarm
  1287. processes write to standard error.  You will only see them if this output also
  1288. goes to, or is redirected to, your display.
  1289. X
  1290. If your shell initialisation script does any output,
  1291. .I xalarm
  1292. may get confused when trying to list other
  1293. .I xalarm
  1294. processes (and therefore also when killing or resetting all
  1295. .I xalarm
  1296. processes).
  1297. .TP 8
  1298. .B Daemons:
  1299. If you terminate the session which an
  1300. .I xalarm
  1301. daemon is running under, the daemon does not exit until just before it re-tries
  1302. to start new alarms from the alarm file.  It is possible, but unlikely, that
  1303. someone else may have got your particular display connection (not physical
  1304. display) in the meantime.
  1305. .I xalarm
  1306. cannot know when this happens.
  1307. X
  1308. It would be nice to be able to tell daemon and normal
  1309. .I xalarm
  1310. processes apart when listing them.
  1311. .TP 8
  1312. .B Saving to file:
  1313. The date saved in the alarm file is the exact date the alarm would trigger, not
  1314. the date specified in the date input popup window.  Both types of behaviour have
  1315. their advantages, but only this behaviour is implemented.
  1316. X
  1317. The same happens with those alarms that are saved when the
  1318. .I X
  1319. session under which they are running is terminated.  This type of behaviour
  1320. does seem more useful than the alternative.
  1321. X
  1322. Currently does not satisfactorily save alarms with multi-line messages.
  1323. .TP 8
  1324. .B Restarting:
  1325. Because uncompleted alarms are saved in the same format as the alarm file
  1326. format, the resource environment of restarted alarms is inherited from the
  1327. .I xalarm
  1328. which restarted them.  This is not necessarily the same as the original
  1329. resource environments of these alarms.
  1330. .TP 8
  1331. .B Times & Dates:
  1332. .I xalarm
  1333. is at the mercy of the system clock.
  1334. X
  1335. The message informing at what time
  1336. .I xalarm
  1337. is to trigger may appear to be wrong if the clocks go forwards or backwards
  1338. between the present and the time it is due to trigger.
  1339. X
  1340. If the time is relative to the present and confirmation is sought, the alarm
  1341. and warnings are set from when the time is confirmed, not from when
  1342. .I xalarm
  1343. was invoked.
  1344. X
  1345. Date and symbol names are recognised by the first three characters only, the
  1346. rest are ignored.  This is why
  1347. .I week
  1348. and
  1349. .I weekly
  1350. are equivalent, and
  1351. .I midday
  1352. and
  1353. .I midnight
  1354. are not implemented.  There is no real wild carding within dates.
  1355. X
  1356. You can only set an alarm that will trigger within the next 49 days (on the
  1357. assumption that your machine has 32-bit unsigned longs).
  1358. .TP 8
  1359. .B Editing:
  1360. The dialog box uses a subset of the
  1361. .I emacs(1)
  1362. editor/environment keymap for text buffers (which is certainly not a bug!).
  1363. X
  1364. However, the 
  1365. .I return
  1366. key event is translated by default into the
  1367. .I confirm
  1368. button event, as it is translated similarly in the alarm time and warning
  1369. dialog boxes.
  1370. To insert a newline, use
  1371. .I ctrl-m
  1372. (since under
  1373. .I emacs(1)
  1374. the
  1375. .I return
  1376. key is a synonym for
  1377. .I ctrl-m,
  1378. under
  1379. .I X
  1380. they generate different events), or just change the relevant resource(s) so
  1381. that
  1382. .I return
  1383. produces the desired effect.  The resources, followed by the necessary value,
  1384. are:
  1385. .TP 8
  1386. X    XAlarm.When?.time.value.translations
  1387. X    XAlarm.When?.date.value.translations
  1388. X    XAlarm.When?.warnings.value.translations
  1389. X    XAlarm.When?.confirm.value.translations
  1390. X
  1391. X                #override <Key>Return: newline()
  1392. .TP 8
  1393. .B Resetting & Killing:
  1394. Signalling is implemented very simply, and if the process signalled is not an
  1395. .I xalarm,
  1396. strange things may occur.  Usually, nothing will happen.
  1397. X
  1398. However, killing does not use the
  1399. .I KILL
  1400. signal, and is therefore relatively safe to use even though your
  1401. .I ps(1)
  1402. can never be 100% reliable.
  1403. X
  1404. Still, this can mean that when you reset or kill all
  1405. .I xalarm
  1406. processes, not all will have been signalled.
  1407. .TP 8
  1408. .B Input:
  1409. Doesn't take input from a pipe etc.
  1410. .TP 8
  1411. .B Audio:
  1412. Doesn't parse the alarm or warning message to produce voice output(!)
  1413. .SH "COPYRIGHT"
  1414. Copyright 1991, 1992, Simon Marshall.
  1415. .SH "AUTHOR"
  1416. Simon Marshall, Ph.D. Self Defense Group, Dept. of Computer Science, University
  1417. Of Hull, UK.  S.Marshall@Hull.ac.UK
  1418. .SH "CONTRIBERS"
  1419. A lot of people have put in effort for
  1420. .I xalarm
  1421. since it was first released in the summer of 1991; testing, suggesting,
  1422. commenting, cajoling and even fixing, in all the areas that software
  1423. development entails.  Not all will have been mentioned below, but thanks for
  1424. your input.
  1425. X
  1426. Big thanks yet again have to go to Gisle Hannemyr, Norsk Regnsesentral (NCC), J
  1427. Braham Levy, UDSP Lab, University of Keele and Ex-Tek Associates (UK), and
  1428. Stefan Haenssgen, Informatik Rechnerabteilung, University of Karlsruhe, for
  1429. their help with ideas, comments and code, in the making of
  1430. .I xalarm
  1431. version 3.03.  Thanks also to Paul Moore for his help in porting
  1432. .I xalarm
  1433. for version 3.04.
  1434. X
  1435. For getting version 3 from version 2 in the first place, thanks have to go to
  1436. Bill Leonard, Harris Computer Systems Division, Florida, for harassing me with
  1437. suggestions for improvements to make
  1438. .I xalarm
  1439. version 3 a useful tool and this manual page easier to understand, and Andreas
  1440. Stolcke, International Computer Science Institute, Berkeley, for his help
  1441. fixing code.  Without both, xalarm would still be pretty much as version 2.
  1442. X
  1443. Thanks also to J Braham Levy, Stefan Haenssgen, Jamie Zawinski, Jason Venner
  1444. and Kimmo Suominen for their help with version 3.
  1445. X
  1446. For their help and suggestions with
  1447. .I xalarm
  1448. "over the years", I would also like to thank (in no real order) Steve Aronson,
  1449. Dave Brooks, Reiner Hammer, Jay Lawlor, Janet Anstett, Gordon Freedman,
  1450. Francois-Regis Colin and Jeffrey Mast.  If I've missed anyone, sorry.
  1451. X
  1452. .SH "COMMENTS"
  1453. I'd welcome any; comments, suggestions, code, bug reports and fixes, etc.
  1454. Don't forget to include which version of
  1455. .I xalarm
  1456. you are using (from
  1457. .I xalarm -version),
  1458. machine/OS,
  1459. .I X
  1460. release & patch number, window manager etc.
  1461. SHAR_EOF
  1462. chmod 0644 xalarm.man ||
  1463. echo 'restore of xalarm.man failed'
  1464. Wc_c="`wc -c < 'xalarm.man'`"
  1465. test 33900 -eq "$Wc_c" ||
  1466.     echo 'xalarm.man: original size 33900, current size' "$Wc_c"
  1467. rm -f _shar_wnt_.tmp
  1468. fi
  1469. # ============= xmemo ==============
  1470. if test -f 'xmemo' -a X"$1" != X"-c"; then
  1471.     echo 'x - skipping xmemo (File already exists)'
  1472.     rm -f _shar_wnt_.tmp
  1473. else
  1474. > _shar_wnt_.tmp
  1475. echo 'x - extracting xmemo (Text)'
  1476. sed 's/^X//' << 'SHAR_EOF' > 'xmemo' &&
  1477. #!/bin/sh
  1478. exec xalarm -time now -date today -noconfirm -nowarn -nopester \
  1479. X    -name xmemo ${1+"$@"}
  1480. SHAR_EOF
  1481. chmod 0755 xmemo ||
  1482. echo 'restore of xmemo failed'
  1483. Wc_c="`wc -c < 'xmemo'`"
  1484. test 98 -eq "$Wc_c" ||
  1485.     echo 'xmemo: original size 98, current size' "$Wc_c"
  1486. rm -f _shar_wnt_.tmp
  1487. fi
  1488. rm -f _shar_seq_.tmp
  1489. echo You have unpacked the last part
  1490. exit 0
  1491. -- 
  1492. --
  1493. Molecular Simulations, Inc.            mail: dcmartin@msi.com
  1494. 796 N. Pastoria Avenue                uucp: uunet!dcmartin
  1495. Sunnyvale, California 94086            at&t: 408/522-9236
  1496.