home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / x / volume16 / xalarm30 / part01 < prev    next >
Encoding:
Internet Message Format  |  1992-02-04  |  56.0 KB

  1. Path: uunet!zaphod.mps.ohio-state.edu!mips!msi!dcmartin
  2. From: S.Marshall@sequent.cc.hull.ac.uk (Simon Marshall)
  3. Newsgroups: comp.sources.x
  4. Subject: v16i036: Xalarm 3.02, Part01/03
  5. Message-ID: <csx-16i036-xalarm-3.02@uunet.UU.NET>
  6. Date: 5 Feb 92 14:47:30 GMT
  7. Sender: dcmartin@msi.com (David C. Martin - Moderator)
  8. Organization: Molecular Simulations, Inc.
  9. Lines: 1848
  10. Approved: dcmartin@msi.com
  11. Originator: dcmartin@fascet
  12.  
  13. Submitted-by: Simon Marshall <S.Marshall@sequent.cc.hull.ac.uk>
  14. Posting-number: Volume 16, Issue 36
  15. Archive-name: xalarm-3.02/part01
  16.  
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  21. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  22. # If this archive is complete, you will see the following message at the end:
  23. #        "End of archive 1 (of 3)."
  24. # Contents:  README Makefile fns.c xalarm.c xalarm.man xmemo
  25. # Wrapped by dcmartin@fascet on Wed Feb  5 06:46:37 1992
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'README' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'README'\"
  29. else
  30. echo shar: Extracting \"'README'\" \(3326 characters\)
  31. sed "s/^X//" >'README' <<'END_OF_FILE'
  32. X                  Readme for xalarm-3
  33. X
  34. X            Welcome to xalarm for X11R4/5
  35. X
  36. X            Ideal for the permanently late, like me
  37. X
  38. X          Copyright (c) 1991, 1992 by Simon Marshall
  39. X
  40. X           If you still end up late, don't blame me!
  41. X
  42. X
  43. XDESCRIPTION
  44. X~~~~~~~~~~~
  45. X
  46. X  xalarm is an interactive program analogous to leave(1), only much more
  47. X  powerful.
  48. X
  49. X  You can set the alarm either by command line options, or by entering the time
  50. X  using the popup window.  The time and date formats are quite flexible and
  51. X  natural.  At the appropriate time, xalarm pops up a window to tell you that
  52. X  your time is up.  You can tell xalarm to pop up warning windows at specified
  53. X  times before the alarm is to trigger in order to warn you of the impending
  54. X  alarm.
  55. X
  56. X  If a time is not given or recognised, or a warning time is not recognised, or
  57. X  confirmation is required, xalarm prompts for one by popping up a window.
  58. X  This gives you an opportunity to change the alarm setting, warnings times,
  59. X  and the message xalarm will display when the alarm is triggered.
  60. X
  61. X  This form is suitable for inclusion as a menu option under a window manager.
  62. X
  63. X  You can make xalarm read alarm times and the messages to display from a file,
  64. X  the alarms will only be set on the dates specified in the file.  This way you
  65. X  can have an appointments file for regular or future dates.
  66. X
  67. X  This form is suitable for inclusion in an X start up or initialisation
  68. X  script.
  69. X
  70. X  xalarm allows you to snooze the alarm after it is triggered, to give you an
  71. X  opportunity to carry on and be late anyway.  Even after you have set the
  72. X  alarm and confirmed it, you can reset the alarm as long as you know the
  73. X  xalarm process number: xalarm can list other xalarm pids.
  74. X
  75. X  xalarm makes maximum use of resources, as well as having a number of command
  76. X  line options, and these can be used to control most of the appearance of
  77. X  xalarm and (just about) all of its behaviour.
  78. X
  79. X  The current xalarm options include:
  80. X    -appointments
  81. X    -time time
  82. X    -warn time[,time...]            -nowarn
  83. X    -confirm                -noconfirm
  84. X    -warnwords number            -nowarnwords
  85. X    -list
  86. X    -reset pid
  87. X    -snooze time
  88. X    -bell    -beep                -nobell    -nobeep
  89. X    -help    -version
  90. X
  91. X  Also supplied are xmemo, xfortune and xyow front ends to xalarm.  Note that
  92. X  xfortune and xyow require the fortune and yow programs respectively, they
  93. X  don't come with this.
  94. X
  95. X  To have a preview of the manual, try something like:
  96. X
  97. X% nroff -man xalarm.man | less        # or "more" if you haven't got "less".
  98. X    or
  99. X% xalarm -help
  100. X
  101. X  See the file INSTALL for help with installation and problems.
  102. X
  103. X
  104. XTHE END
  105. X~~~~~~~
  106. X
  107. X  Xalarm uses Xt & Xaw stuff only, and may well be a useful aid to someone
  108. X  trying to learn X, as I was/am.
  109. X
  110. X  You may have problems with X function names if using R3 or earlier;
  111. X  application contexts are used, but this should not take much changing - using
  112. X  #defines may do most of the job.
  113. X
  114. X  Written in an attempt to learn X Windows in as short a time as possible; it
  115. X  may be written badly, but makes as much use of resources as possible.  I
  116. X  don't think it is (but I wouldn't, would I?) and I have found it is very
  117. X  useful for me now I'm to be responsible for giving lectures...
  118. X
  119. X    Simon.
  120. X_______________________________________________________________________________
  121. X    Simon Marshall, Dept. Computer Science, University of Hull, HU6 7RX, UK
  122. X                 S.Marshall@Hull.ac.UK
  123. END_OF_FILE
  124. if test 3326 -ne `wc -c <'README'`; then
  125.     echo shar: \"'README'\" unpacked with wrong size!
  126. fi
  127. # end of 'README'
  128. fi
  129. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  130.   echo shar: Will not clobber existing file \"'Makefile'\"
  131. else
  132. echo shar: Extracting \"'Makefile'\" \(12283 characters\)
  133. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  134. X# Makefile generated by imake - do not edit!
  135. X# $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
  136. X#
  137. X# The cpp used on this machine replaces all newlines and multiple tabs and
  138. X# spaces in a macro expansion with a single space.  Imake tries to compensate
  139. X# for this, but is not always successful.
  140. X#
  141. X
  142. X# -------------------------------------------------------------------------
  143. X# Makefile generated from "Imake.tmpl" and <Imakefile>
  144. X# $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
  145. X#
  146. X# Platform-specific parameters may be set in the appropriate <vendor>.cf
  147. X# configuration files.  Site-specific parameters should be set in the file
  148. X# site.def.  Full rebuilds are recommended if any parameters are changed.
  149. X#
  150. X# If your C preprocessor does not define any unique symbols, you will need
  151. X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
  152. X# "make World" the first time).
  153. X#
  154. X
  155. X# -------------------------------------------------------------------------
  156. X# site-specific configuration parameters that need to come before
  157. X# the platform-specific parameters - edit site.def to change
  158. X
  159. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  160. X
  161. X# -------------------------------------------------------------------------
  162. X# platform-specific configuration parameters - edit sun.cf to change
  163. X
  164. X# platform:  $XConsortium: sun.cf,v 1.68 91/07/30 11:34:39 rws Exp $
  165. X
  166. X# operating system:  SunOS 4.1.1
  167. X
  168. X# $XConsortium: sunLib.rules,v 1.6 91/03/24 17:55:58 rws Exp $
  169. X
  170. X# -------------------------------------------------------------------------
  171. X# site-specific configuration parameters that go after
  172. X# the platform-specific parameters - edit site.def to change
  173. X
  174. X# site:  $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
  175. X
  176. X            SHELL = /bin/sh
  177. X
  178. X              TOP = .
  179. X      CURRENT_DIR = .
  180. X
  181. X               AR = ar clq
  182. X  BOOTSTRAPCFLAGS =
  183. X               CC = cc
  184. X               AS = as
  185. X
  186. X         COMPRESS = compress
  187. X              CPP = /lib/cpp $(STD_CPP_DEFINES)
  188. X    PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
  189. X          INSTALL = install
  190. X               LD = ld
  191. X             LINT = lint
  192. X      LINTLIBFLAG = -C
  193. X         LINTOPTS = -axz
  194. X               LN = ln -s
  195. X             MAKE = make
  196. X               MV = mv
  197. X               CP = cp
  198. X
  199. X           RANLIB = ranlib
  200. X  RANLIBINSTFLAGS =
  201. X
  202. X               RM = rm -f
  203. X            TROFF = psroff
  204. X         MSMACROS = -ms
  205. X              TBL = tbl
  206. X              EQN = eqn
  207. X     STD_INCLUDES =
  208. X  STD_CPP_DEFINES =
  209. X      STD_DEFINES =
  210. X EXTRA_LOAD_FLAGS =
  211. X  EXTRA_LIBRARIES =
  212. X             TAGS = ctags
  213. X
  214. X    SHAREDCODEDEF = -DSHAREDCODE
  215. X         SHLIBDEF = -DSUNSHLIB
  216. X
  217. X    PROTO_DEFINES =
  218. X
  219. X     INSTPGMFLAGS =
  220. X
  221. X     INSTBINFLAGS = -m 0755
  222. X     INSTUIDFLAGS = -m 4755
  223. X     INSTLIBFLAGS = -m 0644
  224. X     INSTINCFLAGS = -m 0444
  225. X     INSTMANFLAGS = -m 0444
  226. X     INSTDATFLAGS = -m 0444
  227. X    INSTKMEMFLAGS = -m 4755
  228. X
  229. X      PROJECTROOT = /usr/X11/R5
  230. X
  231. X     TOP_INCLUDES = -I$(INCROOT)
  232. X
  233. X      CDEBUGFLAGS = -O
  234. X        CCOPTIONS = -pipe
  235. X
  236. X      ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
  237. X       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
  238. X           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
  239. X        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
  240. X
  241. X           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  242. X
  243. X        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
  244. X
  245. X   LDCOMBINEFLAGS = -X -r
  246. X      DEPENDFLAGS =
  247. X
  248. X        MACROFILE = sun.cf
  249. X           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
  250. X
  251. X    IMAKE_DEFINES =
  252. X
  253. X         IRULESRC = $(CONFIGDIR)
  254. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  255. X
  256. X     ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
  257. X            $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
  258. X            $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
  259. X
  260. X# -------------------------------------------------------------------------
  261. X# X Window System Build Parameters
  262. X# $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
  263. X
  264. X# -------------------------------------------------------------------------
  265. X# X Window System make variables; this need to be coordinated with rules
  266. X
  267. X          PATHSEP = /
  268. X        USRLIBDIR = /usr/X11/R5/lib
  269. X           BINDIR = /usr/X11/R5/bin
  270. X          INCROOT = /usr/X11/R5/include
  271. X     BUILDINCROOT = $(TOP)
  272. X      BUILDINCDIR = $(BUILDINCROOT)/X11
  273. X      BUILDINCTOP = ..
  274. X           INCDIR = $(INCROOT)/X11
  275. X           ADMDIR = /usr/adm
  276. X           LIBDIR = $(USRLIBDIR)/X11
  277. X        CONFIGDIR = $(LIBDIR)/config
  278. X       LINTLIBDIR = $(USRLIBDIR)/lint
  279. X
  280. X          FONTDIR = $(LIBDIR)/fonts
  281. X         XINITDIR = $(LIBDIR)/xinit
  282. X           XDMDIR = $(LIBDIR)/xdm
  283. X           TWMDIR = $(LIBDIR)/twm
  284. X          MANPATH = /usr/X11/R5/man
  285. X    MANSOURCEPATH = $(MANPATH)/man
  286. X        MANSUFFIX = n
  287. X     LIBMANSUFFIX = 3
  288. X           MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
  289. X        LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
  290. X           NLSDIR = $(LIBDIR)/nls
  291. X        PEXAPIDIR = $(LIBDIR)/PEX
  292. X      XAPPLOADDIR = $(LIBDIR)/app-defaults
  293. X       FONTCFLAGS = -t
  294. X
  295. X     INSTAPPFLAGS = $(INSTDATFLAGS)
  296. X
  297. X            IMAKE = imake
  298. X           DEPEND = makedepend
  299. X              RGB = rgb
  300. X
  301. X            FONTC = bdftopcf
  302. X
  303. X        MKFONTDIR = mkfontdir
  304. X        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
  305. X
  306. X        CONFIGSRC = $(TOP)/config
  307. X       DOCUTILSRC = $(TOP)/doc/util
  308. X        CLIENTSRC = $(TOP)/clients
  309. X          DEMOSRC = $(TOP)/demos
  310. X           LIBSRC = $(TOP)/lib
  311. X          FONTSRC = $(TOP)/fonts
  312. X       INCLUDESRC = $(TOP)/X11
  313. X        SERVERSRC = $(TOP)/server
  314. X          UTILSRC = $(TOP)/util
  315. X        SCRIPTSRC = $(UTILSRC)/scripts
  316. X       EXAMPLESRC = $(TOP)/examples
  317. X       CONTRIBSRC = $(TOP)/../contrib
  318. X           DOCSRC = $(TOP)/doc
  319. X           RGBSRC = $(TOP)/rgb
  320. X        DEPENDSRC = $(UTILSRC)/makedepend
  321. X         IMAKESRC = $(CONFIGSRC)
  322. X         XAUTHSRC = $(LIBSRC)/Xau
  323. X          XLIBSRC = $(LIBSRC)/X
  324. X           XMUSRC = $(LIBSRC)/Xmu
  325. X       TOOLKITSRC = $(LIBSRC)/Xt
  326. X       AWIDGETSRC = $(LIBSRC)/Xaw
  327. X       OLDXLIBSRC = $(LIBSRC)/oldX
  328. X      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
  329. X      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
  330. X      BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
  331. X      BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
  332. X     MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
  333. X         FSLIBSRC = $(FONTSRC)/lib/fs
  334. X    FONTSERVERSRC = $(FONTSRC)/server
  335. X     EXTENSIONSRC = $(TOP)/extensions
  336. X         XILIBSRC = $(EXTENSIONSRC)/lib/xinput
  337. X      PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
  338. X
  339. X# $XConsortium: sunLib.tmpl,v 1.11 91/07/31 11:32:08 rws Exp $
  340. X
  341. XSHLIBLDFLAGS = -assert pure-text
  342. XPICFLAGS = -pic
  343. X
  344. X  DEPEXTENSIONLIB =
  345. X     EXTENSIONLIB = -lXext
  346. X
  347. X          DEPXLIB = $(DEPEXTENSIONLIB)
  348. X             XLIB = $(EXTENSIONLIB) -lX11
  349. X
  350. X        DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
  351. X           XMULIB = -lXmu
  352. X
  353. X       DEPOLDXLIB =
  354. X          OLDXLIB = -loldX
  355. X
  356. X      DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
  357. X         XTOOLLIB = -lXt
  358. X
  359. X        DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
  360. X           XAWLIB = -lXaw
  361. X
  362. X        DEPXILIB =
  363. X           XILIB = -lXi
  364. X
  365. X        SOXLIBREV = 4.10
  366. X          SOXTREV = 4.10
  367. X         SOXAWREV = 5.0
  368. X        SOOLDXREV = 4.10
  369. X         SOXMUREV = 4.10
  370. X        SOXEXTREV = 4.10
  371. X      SOXINPUTREV = 4.10
  372. X
  373. X      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
  374. X         XAUTHLIB =  -lXau
  375. X      DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
  376. X         XDMCPLIB =  -lXdmcp
  377. X
  378. X        DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
  379. X           PHIGSLIB =  -lphigs
  380. X
  381. X       DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
  382. X          XBSDLIB =  -lXbsd
  383. X
  384. X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
  385. X         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
  386. X          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
  387. X        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
  388. X          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
  389. X           LINTXI = $(LINTLIBDIR)/llib-lXi.ln
  390. X        LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
  391. X
  392. X          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
  393. X
  394. X         DEPLIBS1 = $(DEPLIBS)
  395. X         DEPLIBS2 = $(DEPLIBS)
  396. X         DEPLIBS3 = $(DEPLIBS)
  397. X
  398. X# -------------------------------------------------------------------------
  399. X# Imake rules for building libraries, programs, scripts, and data files
  400. X# rules:  $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
  401. X
  402. X# -------------------------------------------------------------------------
  403. X# start of Imakefile
  404. X
  405. X# Based on an Imakefile from:
  406. X# Andreas Stolcke
  407. X# International Computer Science Institute, Berkeley.
  408. X
  409. X# If you don't have gethostname() and you can't change the #define in
  410. X# alarm.c to what ever it is on your system, add -DNOGETHOSTNAME here:
  411. XDEFINES = ${SIGNAL_DEFINES}
  412. X
  413. XOBJS  = alarm.o when.o warning.o times.o fns.o xalarm.o
  414. XSRCS  = alarm.c when.c warning.c times.c fns.c xalarm.c
  415. X
  416. XLOCAL_LIBRARIES = $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
  417. X
  418. X PROGRAM = xalarm
  419. X
  420. Xall:: xalarm
  421. X
  422. Xxalarm: $(OBJS) $(DEPLIBS)
  423. X    $(RM) $@
  424. X    $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
  425. X
  426. Xsaber_xalarm:: $(SRCS)
  427. X    # load $(ALLDEFINES) $(SRCS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  428. X
  429. Xosaber_xalarm:: $(OBJS)
  430. X    # load $(ALLDEFINES) $(OBJS) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
  431. X
  432. Xinstall:: xalarm
  433. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  434. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  435. X    $(INSTALL) -c $(INSTPGMFLAGS)  xalarm $(DESTDIR)$(BINDIR)
  436. X
  437. Xinstall.man:: xalarm.man
  438. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  439. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  440. X    $(INSTALL) -c $(INSTMANFLAGS) xalarm.man $(DESTDIR)$(MANDIR)/xalarm.$(MANSUFFIX)
  441. X
  442. Xdepend::
  443. X    $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
  444. X
  445. Xlint:
  446. X    $(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
  447. Xlint1:
  448. X    $(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
  449. X
  450. Xclean::
  451. X    $(RM) $(PROGRAM)
  452. X
  453. Xinstall:: XAlarm.ad
  454. X    @if [ -d $(DESTDIR)$(XAPPLOADDIR) ]; then set +x; \
  455. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(XAPPLOADDIR)); fi
  456. X    $(INSTALL) -c $(INSTAPPFLAGS) XAlarm.ad $(DESTDIR)$(XAPPLOADDIR)/XAlarm
  457. X
  458. Xinstall:: xmemo xfortune xyow
  459. X    @if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
  460. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
  461. X    @case '${MFLAGS}' in *[i]*) set +e;; esac; \
  462. X    for i in xmemo xfortune xyow; do \
  463. X    (set -x; $(INSTALL) -c $(INSTBINFLAGS) $$i $(DESTDIR)$(BINDIR)); \
  464. X    done
  465. X
  466. Xinstall.man:: xmemo.man
  467. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  468. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  469. X    $(INSTALL) -c $(INSTMANFLAGS) xmemo.man $(DESTDIR)$(MANDIR)/xmemo.$(MANSUFFIX)
  470. X
  471. Xinstall.man:: xfortune.man
  472. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  473. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  474. X    $(INSTALL) -c $(INSTMANFLAGS) xfortune.man $(DESTDIR)$(MANDIR)/xfortune.$(MANSUFFIX)
  475. X
  476. Xinstall.man:: xyow.man
  477. X    @if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
  478. X    else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
  479. X    $(INSTALL) -c $(INSTMANFLAGS) xyow.man $(DESTDIR)$(MANDIR)/xyow.$(MANSUFFIX)
  480. X
  481. Xfns.h:
  482. X    @config.1st
  483. X
  484. Xxmemo.man xyow.man xfortune.man:
  485. X    echo ".so man"`echo n`"/xalarm."`echo n` > $@
  486. X
  487. Xxfortune::
  488. X
  489. Xxyow::
  490. X
  491. Xclean::
  492. X    $(RM) xfortune xyow xmemo.man xyow.man xfortune.man fns.h
  493. X
  494. Xconfig::
  495. X    @chmod +x config.1st fullpath xmemo
  496. X    @config.1st fortune yow
  497. X    @xrdb -merge XAlarm.ad
  498. X    @xrdb -merge XAlarm.ad+
  499. X
  500. Xalarm.o: xalarm.h patchlevel.h
  501. Xwhen.o: xalarm.h patchlevel.h
  502. Xwarning.o: xalarm.h patchlevel.h
  503. Xtimes.o: xalarm.h patchlevel.h
  504. Xfns.o: xalarm.h patchlevel.h fns.h
  505. Xxalarm.o: xalarm.h patchlevel.h
  506. X
  507. X# -------------------------------------------------------------------------
  508. X# common rules for all Makefiles - do not edit
  509. X
  510. Xemptyrule::
  511. X
  512. Xclean::
  513. X    $(RM_CMD) "#"*
  514. X
  515. XMakefile::
  516. X    -@if [ -f Makefile ]; then set -x; \
  517. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  518. X    else exit 0; fi
  519. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  520. X
  521. Xtags::
  522. X    $(TAGS) -w *.[ch]
  523. X    $(TAGS) -xw *.[ch] > TAGS
  524. X
  525. Xsaber:
  526. X    # load $(ALLDEFINES) $(SRCS)
  527. X
  528. Xosaber:
  529. X    # load $(ALLDEFINES) $(OBJS)
  530. X
  531. X# -------------------------------------------------------------------------
  532. X# empty rules for directories that do not have SUBDIRS - do not edit
  533. X
  534. Xinstall::
  535. X    @echo "install in $(CURRENT_DIR) done"
  536. X
  537. Xinstall.man::
  538. X    @echo "install.man in $(CURRENT_DIR) done"
  539. X
  540. XMakefiles::
  541. X
  542. Xincludes::
  543. X
  544. X# -------------------------------------------------------------------------
  545. X# dependencies generated by makedepend
  546. X
  547. END_OF_FILE
  548. if test 12283 -ne `wc -c <'Makefile'`; then
  549.     echo shar: \"'Makefile'\" unpacked with wrong size!
  550. fi
  551. # end of 'Makefile'
  552. fi
  553. if test -f 'fns.c' -a "${1}" != "-c" ; then 
  554.   echo shar: Will not clobber existing file \"'fns.c'\"
  555. else
  556. echo shar: Extracting \"'fns.c'\" \(9902 characters\)
  557. sed "s/^X//" >'fns.c' <<'END_OF_FILE'
  558. X/*
  559. X      Copyright (c) 1991, 1992 by Simon Marshall, University of Hull, UK
  560. X
  561. X           If you still end up late, don't blame me!
  562. X                       
  563. X  Permission to use, copy, modify, distribute, and sell this software and its
  564. X       documentation for any purpose and without fee is hereby granted,
  565. X    provided that the above copyright notice appear in all copies and that
  566. X    both that copyright notice and this permission notice appear in
  567. X               supporting documentation.
  568. X                       
  569. X  This software is provided AS IS with no warranties of any kind.  The author
  570. X    shall have no liability with respect to the infringement of copyrights,
  571. X     trade secrets or any patents by this file or any part thereof.  In no
  572. X      event will the author be liable for any lost revenue or profits or
  573. X          other special, indirect and consequential damages.
  574. X*/
  575. X
  576. X/* 
  577. X * Just a few bits and bobs.
  578. X */
  579. X
  580. X
  581. X#include "xalarm.h"
  582. X#include "fns.h"
  583. X
  584. X
  585. X
  586. X/* 
  587. X * This is cos of a bug of some sort spotted on a Sparc 2 (SunOS 4.1.1), X11r4,
  588. X * whereby X crashes if given a zero timeout.  Just woof it up a bit.
  589. X */
  590. X
  591. X#if defined(SparcArchitecture)
  592. X#define        TIMEOUT(t)    ((t) < 100 ? 100 : (t))
  593. X#else
  594. X#define        TIMEOUT(t)    (t)
  595. X#endif
  596. X
  597. X#define        APPOINTMENTS    "-appointments"
  598. X#define        COMMAND        \
  599. X    "echo xalarms: `%s -cx | %s xalarm | %s 7 | %s -v %d`"
  600. X
  601. X
  602. X
  603. XString        Concat(), *PreParseArgList();
  604. Xvoid        Initialise(), DoAppointments(), SetGeometry(), AddTimeOuts(), Quit();
  605. Xstatic void    CentreWidgetUnderPointer(), ParseGeometry();
  606. XSIGRET        ResetAlarm();
  607. Xextern void    DoAlarm(), Warning(), WakeUp(), PopupAndAsk();
  608. Xextern int    fork();
  609. Xextern long    TimeToMilliSeconds();
  610. Xextern Boolean    AppointmentIsToday();
  611. Xextern String    getenv();
  612. Xextern time_t    time();
  613. X
  614. X
  615. X
  616. Xextern AlarmData   xalarm;
  617. X
  618. X
  619. X
  620. X/* 
  621. X * Just give a bit of help etc.
  622. X * Fork off a child otherwise.
  623. X */
  624. X
  625. Xvoid Initialise (proggie, data)
  626. X  String     proggie;
  627. X  ApplDataPtr     data;
  628. X{
  629. X    char   command[TEXT];
  630. X
  631. X    if (data->proggie == (char *) NULL)
  632. X    data->proggie = proggie;
  633. X
  634. X    if (data->version)
  635. X    (void) printf ("%s: using xalarm version %s\n",
  636. X               data->proggie, VERSION);
  637. X
  638. X    if (data->help) {
  639. X    (void) printf ("Usage: %s [options] [text]\n\n", data->proggie);
  640. X    (void) printf ("Default values for these resources/options are used by %s,\n\t",
  641. X               data->proggie);
  642. X    (void) printf ("but may be over-ruled.\n");
  643. X    (void) printf ("Usual X options, plus:\n\t");
  644. X    (void) printf ("-appointments\t\tSet alarms for today from xalarm file.\n\t");
  645. X    (void) printf ("-time time\t\tTime at which to trigger %s.\n\t", data->proggie+1);
  646. X    (void) printf ("-warn time[,time...]\tTimes before %s for warnings.\n\t",
  647. X               data->proggie+1);
  648. X    (void) printf ("-warnwords number\tWords from %s message in warning.\n\t",
  649. X               data->proggie+1);
  650. X    (void) printf ("-list\t\t\tList xalarm process numbers (pids).\n\t");
  651. X    (void) printf ("-reset pid\t\tReset alarm for xalarm process number pid.\n\t");
  652. X    (void) printf ("-snooze time\t\tSet initial alarm snooze time value.\n\t");
  653. X    (void) printf ("-nowarn\t\t\tNo warnings.\n\t");
  654. X    (void) printf ("-nowarnwords\t\tNo words from %s message in warning.\n\t",
  655. X               data->proggie+1);
  656. X    (void) printf ("-[no]confirm\t\t[Don't] ask for confirmation.\n\t");
  657. X    (void) printf ("-[no]bell\t\t[Don't] beep on warnings and %s.\n", data->proggie+1);
  658. X    }
  659. X
  660. X    if (data->list) {
  661. X    (void) sprintf (command, COMMAND, PS, FGREP, COLRM, FGREP, getpid());
  662. X    (void) system (command);
  663. X    }
  664. X
  665. X    if (data->reset > 0)
  666. X    if (kill (data->reset, SIGUSR1) == -1)
  667. X        perror (data->proggie);
  668. X
  669. X    if ((data->list) or (data->version) or (data->help) or (data->reset > 0))
  670. X    exit (0);
  671. X
  672. X    /* 
  673. X     * Fork & exit the parent.  If the fork fails, carry on anyway.
  674. X     * Is this OK?  Should we sleep a bit first?
  675. X     */
  676. X    switch (fork ()) {
  677. X     case -1:
  678. X    perror (data->proggie);
  679. X     case 0:
  680. X    break;
  681. X     default:
  682. X    exit (0);
  683. X    }
  684. X}
  685. X
  686. X
  687. X
  688. X/* 
  689. X * Parse each line of the alarm file, if it's around.  If the 
  690. X * appointment is today, fork and do the alarm.
  691. X */
  692. X
  693. Xvoid DoAppointments (argv, argc)
  694. X  String   argv[];
  695. X  int        argc;
  696. X{
  697. X    FILE    *file;
  698. X    String   alarm, timestr;
  699. X    char     filename[TEXT], line[TEXT];
  700. X    int      newargc, endofdate;
  701. X
  702. X    if ((alarm = getenv ("XALARM")) == (char *) NULL)
  703. X    alarm = XtNewString (".xalarm");
  704. X    if (alarm[0] == '/')
  705. X    (void) sprintf (filename, "%s", alarm);
  706. X    else
  707. X    (void) sprintf (filename, "%s/%s", getenv ("HOME"), alarm);
  708. X
  709. X    if ((file = fopen (filename, "r")) == (FILE *) NULL) {
  710. X    perror (filename);
  711. X    exit (1);
  712. X    }
  713. X
  714. X    while (fgets (line, TEXT, file) != (char *) NULL) {
  715. X    endofdate = 0;
  716. X    if (AppointmentIsToday (line, ×tr, &endofdate)) {      
  717. X        while (isspace (line[endofdate]))
  718. X        endofdate++;
  719. X
  720. X        argv[argc-1] = XtNewString ("-time");
  721. X        argv[argc] = timestr;
  722. X
  723. X        if (line[endofdate] == '\0')
  724. X        newargc = argc + 1;
  725. X        else {
  726. X        line[strlen (line) - 1] = '\0';
  727. X        argv[argc+1] = line+endofdate;
  728. X        newargc = argc + 2;
  729. X        }
  730. X        switch (fork ()) {
  731. X         case -1:
  732. X        perror ("xalarm");
  733. X        exit (-1);
  734. X         case 0:
  735. X        DoAlarm (argv, newargc);
  736. X        }
  737. X    }
  738. X    }
  739. X    exit (0);
  740. X}
  741. X
  742. X
  743. X
  744. X/* 
  745. X * Returns a string concated from the given array of strings.
  746. X * Separates the strings with a newline.
  747. X *
  748. X * Hacked from various books on X & Xt.
  749. X */
  750. X
  751. XString Concat (strings, n)
  752. X  String  *strings;
  753. X  int        n;
  754. X{
  755. X    String        buffer;
  756. X    unsigned int   i, len = 0;
  757. X
  758. X    if (n <= 1)
  759. X    return ((String) NULL);
  760. X
  761. X    for (i=1; i<n; i++)
  762. X    len += strlen (strings[i]);
  763. X    len += (n-1);
  764. X
  765. X    buffer = XtMalloc (len+1);
  766. X    buffer[0] = '\0';
  767. X    for (i=1; i<n; i++) {
  768. X    if (i > 1)
  769. X        (void) strcat (buffer, "\n");
  770. X    (void) strcat (buffer, strings[i]);
  771. X    }
  772. X
  773. X    return (buffer);
  774. X}
  775. X
  776. X
  777. X
  778. X/* 
  779. X * Check to see if we're to do the appointments thing, and copy out 
  780. X * the arg list, then clear it all.
  781. X */
  782. X
  783. XString *PreParseArgList (app, argv, argc)
  784. X  Boolean  *app;
  785. X  String   *argv;
  786. X  int         argc;
  787. X{
  788. X    String  *args = (String *) XtCalloc (argc+2, sizeof (String *));
  789. X    String   ch, end;
  790. X    int      i, first, offset;
  791. X
  792. X    *app = (argc > 1) ? (strcmp (argv[1], APPOINTMENTS) == 0) : False;
  793. X
  794. X    first = (*app) ? 2 : 1;
  795. X    offset = (*app) ? 1 : 0;
  796. X    args[0] = XtNewString (argv[0]);
  797. X    for (i=first; i<argc; i++) {
  798. X    args[i-offset] = XtNewString (argv[i]);
  799. X    }
  800. X
  801. X    for (i=1; i<argc; i++) {
  802. X    end = argv[i] + strlen (argv[i]);
  803. X    for (ch=argv[i]; ch<end; ch++)
  804. X        *ch = '\0';
  805. X    }
  806. X
  807. X    return (args);
  808. X}
  809. X
  810. X
  811. X
  812. X/* 
  813. X * We add the time outs for the alarm & warnings.
  814. X * The warnings are added only if there is time enuf to go.
  815. X * ie. if "-time +10 -warn 15" you will get nowt.
  816. X * "-time +10 -warn 9" will, however, give you a warning in 1 min.
  817. X */
  818. X
  819. Xvoid AddTimeOuts ()
  820. X{
  821. X    int   i;
  822. X    
  823. X    xalarm.settime = time ((time_t *) NULL);
  824. X
  825. X    for (i=0; i<xalarm.numwarnings; i++)
  826. X    if (xalarm.timeout > xalarm.warnings[i])
  827. X        xalarm.timeouts[i] =
  828. X        XtAppAddTimeOut (xalarm.appcon,
  829. X                 TIMEOUT (xalarm.timeout - xalarm.warnings[i]),
  830. X                 Warning, (XtPointer) (xalarm.warnings[i]/(1000*60)));
  831. X    xalarm.timeouts[xalarm.numwarnings] =
  832. X    XtAppAddTimeOut (xalarm.appcon, TIMEOUT (xalarm.timeout),
  833. X             WakeUp, (XtPointer) NULL);
  834. X}
  835. X  
  836. X   
  837. X
  838. X/* 
  839. X * Let's popup to reset our alarm.
  840. X */
  841. X
  842. XSIGRET ResetAlarm (sig, code, scp, addr)
  843. X  int               sig, code;
  844. X  struct sigcontext  *scp;
  845. X  char              *addr;
  846. X{
  847. X    time_t   now;
  848. X    int      i;
  849. X
  850. X    now = time ((time_t *) NULL);
  851. X    for (i=0; i<xalarm.numwarnings; i++)
  852. X    if ((xalarm.timeout - (now - xalarm.settime)) > xalarm.warnings[i])
  853. X        XtRemoveTimeOut (xalarm.timeouts[i]);
  854. X    XtRemoveTimeOut (xalarm.timeouts[xalarm.numwarnings]);
  855. X
  856. X    xalarm.timeout = TimeToMilliSeconds (xalarm.timestr);
  857. X
  858. X    PopupAndAsk ();
  859. X}
  860. X
  861. X
  862. X
  863. X/* 
  864. X * Set the geometry of the given widget.
  865. X */
  866. X
  867. Xvoid SetGeometry (widget)
  868. X  Widget   widget;
  869. X{
  870. X    Dimension     width, height;
  871. X        
  872. X    if (not XtIsRealized (widget))
  873. X    XtRealizeWidget (widget);
  874. X
  875. X    XtVaGetValues (widget, XtNwidth, &width, XtNheight, &height, NULL);
  876. X
  877. X    if (strcmp (xalarm.geometry, NOGEOMETRY) != 0)
  878. X    ParseGeometry (widget, (int) width, (int) height, xalarm.geometry);
  879. X    else
  880. X    CentreWidgetUnderPointer (widget, (int) width, (int) height);
  881. X}
  882. X
  883. X
  884. X
  885. X/* 
  886. X * Move the given widget so that it is directly underneath the pointer.
  887. X */
  888. X
  889. Xstatic void CentreWidgetUnderPointer (widget, width, height)
  890. X  Widget   widget;
  891. X  int        width, height;
  892. X{
  893. X    Window        root, child;
  894. X    int        x, y, dummy;
  895. X    unsigned int   mask;
  896. X
  897. X    (void) XQueryPointer (XtDisplay (widget), XtWindow (widget),
  898. X              &root, &child, &x, &y, &dummy, &dummy, &mask);
  899. X
  900. X    x = MAX (0, MIN (x - (width / 2), WidthOfScreen (XtScreen (widget)) - width));
  901. X    y = MAX (0, MIN (y - (height / 2), HeightOfScreen (XtScreen (widget)) - height));
  902. X
  903. X    XtVaSetValues (widget, XtNx, (XtArgVal) x, XtNy, (XtArgVal) y, NULL);
  904. X}
  905. X
  906. X
  907. X
  908. X/* 
  909. X * Move +/ resize the given widget so that it has the given geometry.
  910. X */
  911. X
  912. Xstatic void ParseGeometry (widget, width, height, geometry)
  913. X  Widget   widget;
  914. X  String   geometry;
  915. X  int        width, height;
  916. X{
  917. X    int   mask, x=0, y=0;
  918. X
  919. X    mask = XParseGeometry (geometry, &x, &y,
  920. X               (unsigned int *) &width, (unsigned int *) &height);
  921. X
  922. X    if (mask & WidthValue)
  923. X    XtVaSetValues (widget, XtNwidth, (XtArgVal) width, NULL);
  924. X    if (mask & HeightValue)
  925. X    XtVaSetValues (widget, XtNheight, (XtArgVal) height, NULL);
  926. X    if (mask & (WidthValue | HeightValue))
  927. X    XtVaSetValues (widget, XtNallowShellResize, (XtArgVal) False, NULL);
  928. X
  929. X    if (not (mask & (XValue | YValue)))
  930. X    CentreWidgetUnderPointer (widget, width, height);
  931. X    else {
  932. X    if (mask & XNegative)
  933. X        x = x + WidthOfScreen (XtScreen (widget)) - width;
  934. X    if (mask & YNegative)
  935. X        y = y + HeightOfScreen (XtScreen (widget)) - height;
  936. X    XtVaSetValues (widget, XtNx, (XtArgVal) x, XtNy, (XtArgVal) y, NULL);
  937. X    }
  938. X}
  939. X
  940. X
  941. X
  942. X/* 
  943. X * This function generates a random number and stuffs it down the pipe.
  944. X */
  945. X
  946. Xvoid Quit (widget, clientdata, calldata)
  947. X  Widget      widget;
  948. X  XtPointer   clientdata, calldata;
  949. X{
  950. X    XtDestroyApplicationContext (xalarm.appcon);
  951. X    exit (0);
  952. X}
  953. END_OF_FILE
  954. if test 9902 -ne `wc -c <'fns.c'`; then
  955.     echo shar: \"'fns.c'\" unpacked with wrong size!
  956. fi
  957. # end of 'fns.c'
  958. fi
  959. if test -f 'xalarm.c' -a "${1}" != "-c" ; then 
  960.   echo shar: Will not clobber existing file \"'xalarm.c'\"
  961. else
  962. echo shar: Extracting \"'xalarm.c'\" \(7172 characters\)
  963. sed "s/^X//" >'xalarm.c' <<'END_OF_FILE'
  964. X/*
  965. X      Copyright (c) 1991, 1992 by Simon Marshall, University of Hull, UK
  966. X
  967. X           If you still end up late, don't blame me!
  968. X                       
  969. X  Permission to use, copy, modify, distribute, and sell this software and its
  970. X       documentation for any purpose and without fee is hereby granted,
  971. X    provided that the above copyright notice appear in all copies and that
  972. X    both that copyright notice and this permission notice appear in
  973. X               supporting documentation.
  974. X                       
  975. X  This software is provided AS IS with no warranties of any kind.  The author
  976. X    shall have no liability with respect to the infringement of copyrights,
  977. X     trade secrets or any patents by this file or any part thereof.  In no
  978. X      event will the author be liable for any lost revenue or profits or
  979. X          other special, indirect and consequential damages.
  980. X*/
  981. X
  982. X/* 
  983. X * The marvelous xalarm proggie, or, how to write an X prog in 2 wks.
  984. X * 
  985. X * Main bit of prog, just deal with parsing command line options etc 
  986. X * (well, letting XtAppInitialize() do it) & setting up stuff by 
  987. X * calling out to other fns.
  988. X */
  989. X
  990. X
  991. X
  992. X#include "xalarm.h"
  993. X
  994. X
  995. Xvoid        DoAlarm();
  996. Xstatic void    SetAlarm();
  997. Xextern void    Initialise(), CreateAlarmWidget(), PopupAndAsk(), DoAppointments();
  998. Xextern SIGRET    ResetAlarm();
  999. Xextern void    AddTimeOuts(), EnteredTime(), EnteredWarnings(), Confirmed();
  1000. Xextern void    SetWarningTimes(), ShowSnoozeValue(), ShowClickToZero(), Quit();
  1001. Xextern long    TimeToMilliSeconds();
  1002. Xextern String   Concat();
  1003. Xextern String  *PreParseArgList();
  1004. X
  1005. X
  1006. X
  1007. Xstatic XtResource resources[] = {
  1008. X    {XtNtime,        XtCTime,    XtRString,    sizeof (String),
  1009. X     XtOffset (ApplDataPtr, time),    XtRString,    ""},
  1010. X    {XtNwarnings,    XtCWarnings,    XtRString,    sizeof (String),
  1011. X     XtOffset (ApplDataPtr, warnings),    XtRString,    NULL},
  1012. X    {XtNwarningwords,    XtCWarningwords,XtRInt,        sizeof (int),
  1013. X     XtOffset (ApplDataPtr, warningwords),XtRString,    0},
  1014. X    {XtNsnooze,        XtCSnooze,    XtRString,    sizeof (String),
  1015. X     XtOffset (ApplDataPtr, snooze),    XtRString,    NULL},
  1016. X    {XtNconfirm,    XtCConfirm,    XtRBoolean,    sizeof (Boolean),
  1017. X     XtOffset (ApplDataPtr, confirm),    XtRString,    NULL},
  1018. X    {XtNreset,        XtCReset,    XtRInt,        sizeof (int),
  1019. X     XtOffset (ApplDataPtr, reset),    XtRString,    NULL},
  1020. X    {XtNbell,        XtCBell,    XtRBoolean,    sizeof (Boolean),
  1021. X     XtOffset (ApplDataPtr, bell),    XtRString,    NULL},
  1022. X    {XtNlist,        XtCList,    XtRBoolean,    sizeof (Boolean),
  1023. X     XtOffset (ApplDataPtr, list),    XtRString,    "False"},
  1024. X    {XtNversion,    XtCVersion,    XtRBoolean,    sizeof (Boolean),
  1025. X     XtOffset (ApplDataPtr, version),    XtRString,    "False"},
  1026. X    {XtNhelp,        XtCHelp,    XtRBoolean,    sizeof (Boolean),
  1027. X     XtOffset (ApplDataPtr, help),    XtRString,    "False"},
  1028. X    {XtNname,        XtCName,    XtRString,    sizeof (String),
  1029. X     XtOffset (ApplDataPtr, proggie),    XtRString,    NULL},
  1030. X    {XtNgeometry,    XtCGeometry,    XtRString,    sizeof (String),
  1031. X     XtOffset (ApplDataPtr, geometry),    XtRString,    NOGEOMETRY},
  1032. X};
  1033. X        
  1034. X
  1035. X
  1036. Xstatic XrmOptionDescRec options[] = {
  1037. X    {"-time",        ".time",    XrmoptionSepArg,    ""},
  1038. X    {"-t",        ".time",    XrmoptionSepArg,    ""},
  1039. X    {"-warn",        ".warnings",    XrmoptionSepArg,    NULL},
  1040. X    {"-w",        ".warnings",    XrmoptionSepArg,    NULL},
  1041. X    {"-nowarn",        ".warnings",    XrmoptionNoArg,        ""},
  1042. X    {"-nw",        ".warnings",    XrmoptionNoArg,        ""},
  1043. X    {"-warnwords",    ".warningwords",XrmoptionSepArg,    NULL},
  1044. X    {"-ww",        ".warningwords",XrmoptionSepArg,    NULL},
  1045. X    {"-nowarnwords",    ".warningwords",XrmoptionNoArg,        "0"},
  1046. X    {"-noww",        ".warningwords",XrmoptionNoArg,        "0"},
  1047. X    {"-confirm",    ".confirm",    XrmoptionNoArg,        "True"},
  1048. X    {"-c",        ".confirm",    XrmoptionNoArg,        "True"},
  1049. X    {"-noconfirm",    ".confirm",    XrmoptionNoArg,        "False"},
  1050. X    {"-nc",        ".confirm",    XrmoptionNoArg,        "False"},
  1051. X    {"-snooze",        ".snooze",    XrmoptionSepArg,    NULL},
  1052. X    {"-s",        ".snooze",    XrmoptionSepArg,    NULL},
  1053. X    {"-reset",        ".reset",    XrmoptionSepArg,    NULL},
  1054. X    {"-r",        ".reset",    XrmoptionSepArg,    NULL},
  1055. X    {"-bell",        ".bell",    XrmoptionNoArg,        "True"},
  1056. X    {"-beep",        ".bell",    XrmoptionNoArg,        "True"},
  1057. X    {"-b",        ".bell",    XrmoptionNoArg,        "True"},
  1058. X    {"-nobell",        ".bell",    XrmoptionNoArg,        "False"},
  1059. X    {"-nobeep",        ".bell",    XrmoptionNoArg,        "False"},
  1060. X    {"-nb",        ".bell",    XrmoptionNoArg,        "False"},
  1061. X    {"-list",        ".list",    XrmoptionNoArg,        "True"},
  1062. X    {"-l",        ".list",    XrmoptionNoArg,        "True"},
  1063. X    {"-version",    ".version",    XrmoptionNoArg,        "True"},
  1064. X    {"-v",        ".version",    XrmoptionNoArg,        "True"},
  1065. X    {"-help",        ".help",    XrmoptionNoArg,        "True"},
  1066. X    {"-h",        ".help",    XrmoptionNoArg,        "True"},
  1067. X    {"-geometry",    ".geometry",    XrmoptionSepArg,    NULL},
  1068. X    {"-g",        ".geometry",    XrmoptionSepArg,    NULL},
  1069. X};
  1070. X
  1071. X
  1072. X
  1073. Xstatic XtActionsRec actions[] = {
  1074. X    {"Quit",        Quit},
  1075. X    {"EnteredTime",    EnteredTime},
  1076. X    {"EnteredWarnings",    EnteredWarnings},
  1077. X    {"Confirmed",    Confirmed},
  1078. X    {"ShowClickToZero",    ShowClickToZero},
  1079. X    {"ShowSnoozeValue",    ShowSnoozeValue}
  1080. X};
  1081. X
  1082. X
  1083. X
  1084. XAlarmData       xalarm;
  1085. X
  1086. X
  1087. X
  1088. Xvoid main (argc, argv)
  1089. X  int        argc;
  1090. X  String   argv[];
  1091. X{
  1092. X    String   *args;
  1093. X    Boolean   appointments;
  1094. X
  1095. X    args = PreParseArgList (&appointments, argv, argc);
  1096. X
  1097. X    if (appointments)
  1098. X    DoAppointments (args, argc);
  1099. X    else
  1100. X    DoAlarm (args, argc);
  1101. X}
  1102. X
  1103. X
  1104. X
  1105. Xvoid DoAlarm (argv, argc)
  1106. X  int        argc;
  1107. X  String   argv[];
  1108. X{
  1109. X    ApplData   data;
  1110. X
  1111. X    xalarm.toplevel = XtAppInitialize (&xalarm.appcon, "XAlarm",
  1112. X                       options, XtNumber (options), &argc, argv,
  1113. X                       (String *) NULL, (ArgList) NULL, 0);
  1114. X    
  1115. X    XtGetApplicationResources (xalarm.toplevel, &data,
  1116. X                   resources, XtNumber (resources), (ArgList) NULL, 0);
  1117. X
  1118. X    XtAppAddActions (xalarm.appcon, actions, XtNumber (actions));
  1119. X
  1120. X    /* 
  1121. X     * First initialise; exit or fork.
  1122. X     * We have to make the alarm widget first, as SetAlarm() may popup 
  1123. X     * a dialog box which may need to know the alarm widget's label.
  1124. X     */
  1125. X
  1126. X    Initialise (argv[0], &data);
  1127. X    CreateAlarmWidget (Concat (argv, argc));
  1128. X    SetAlarm (&data);
  1129. X
  1130. X    XtAppMainLoop (xalarm.appcon);
  1131. X}       
  1132. X           
  1133. X           
  1134. X
  1135. X/* 
  1136. X * If the time is not given, pop up and ask for it, otherwise add the 
  1137. X * time outs.  Get the warnings first, tho.
  1138. X */
  1139. X
  1140. Xstatic void SetAlarm (data)
  1141. X  ApplDataPtr     data;
  1142. X{
  1143. X    char   snoozetime[TEXT];
  1144. X
  1145. X    snoozetime[0] = '+';
  1146. X    (void) strcpy (snoozetime+1, data->snooze);
  1147. X    xalarm.snooze = TimeToMilliSeconds (snoozetime) / (60*1000);
  1148. X
  1149. X    xalarm.warningwords = data->warningwords;
  1150. X    xalarm.bell = data->bell;
  1151. X    xalarm.confirm = data->confirm;
  1152. X    xalarm.proggie = data->proggie;
  1153. X    xalarm.geometry = data->geometry;
  1154. X
  1155. X    /* 
  1156. X     * Get the time from the time string, and the warnings from the 
  1157. X     * warnings string...
  1158. X     */
  1159. X    xalarm.timeout = TimeToMilliSeconds (xalarm.timestr = data->time);
  1160. X    SetWarningTimes (xalarm.warningsstr = data->warnings);
  1161. X
  1162. X    /* 
  1163. X     * If ``invalid'' (may not have been given anyway), popup.
  1164. X     * If ok, but we want confirmation, popup to check.  (this is cheating!)
  1165. X     * There is no waiting for confirmation if the timeout is 0 - the user
  1166. X     * will soon realise that there was something wrong...
  1167. X     */
  1168. X    if ((ISINVALID (xalarm.timeout)) or
  1169. X    (ISINVALID (xalarm.numwarnings)) or
  1170. X    (xalarm.confirm and (xalarm.timeout != 0)))
  1171. X    PopupAndAsk ();
  1172. X    else
  1173. X    AddTimeOuts ();
  1174. X
  1175. X    (void) signal (SIGUSR1, ResetAlarm);
  1176. X}
  1177. END_OF_FILE
  1178. if test 7172 -ne `wc -c <'xalarm.c'`; then
  1179.     echo shar: \"'xalarm.c'\" unpacked with wrong size!
  1180. fi
  1181. # end of 'xalarm.c'
  1182. fi
  1183. if test -f 'xalarm.man' -a "${1}" != "-c" ; then 
  1184.   echo shar: Will not clobber existing file \"'xalarm.man'\"
  1185. else
  1186. echo shar: Extracting \"'xalarm.man'\" \(19025 characters\)
  1187. sed "s/^X//" >'xalarm.man' <<'END_OF_FILE'
  1188. X.TH XALARM 1 "Release 4" "X Version 11"
  1189. X.SH NAME
  1190. Xxalarm - alarm clock for X
  1191. X.LP
  1192. Xxmemo - memo for X
  1193. X.LP
  1194. Xxfortune - fortune for X
  1195. X.LP
  1196. Xxyow - yow for X
  1197. X.SH SYNOPSIS
  1198. X.B xalarm
  1199. X[-\fItoolkitoption\fP ...] [-option ...] [message_text]
  1200. X.LP
  1201. X.B xmemo
  1202. X[-\fItoolkitoption\fP ...] [-option ...] [message_text]
  1203. X.LP
  1204. X.B xfortune
  1205. X[-\fItoolkitoption\fP ...] [-option ...]
  1206. X.LP
  1207. X.B xyow
  1208. X[-\fItoolkitoption\fP ...] [-option ...]
  1209. X.SH DESCRIPTION
  1210. X.I xalarm 
  1211. Xis an interactive alarm program for X11, analogous to
  1212. X.I leave(1),
  1213. Xbut much more powerful.  You can set the alarm either on the command line
  1214. Xor by using the popup window.  At the appropriate time,
  1215. X.I xalarm
  1216. Xpops up a window to tell you that your time is up.  The time the alarm is to
  1217. Xtrigger may be a specific time or a time for
  1218. X.I xalarm
  1219. Xto wait before triggering.
  1220. X
  1221. XYou can tell 
  1222. X.I xalarm
  1223. Xto pop up warning windows at specified times before the alarm is to trigger,
  1224. Xin order to warn you of the impending triggering of the alarm, and specify
  1225. Xwhat message you want the alarm to display.
  1226. X
  1227. XYou can also make
  1228. X.I xalarm
  1229. Xread alarm times and dates, along with the message to display in the alarm,
  1230. Xfrom a file.  This enables you to forget your regular or important
  1231. Xappointments, but
  1232. X.I xalarm
  1233. Xwill tell you by popping up at the appropriate time.
  1234. X
  1235. XThe alarm window itself consists of a box of buttons and an area containing
  1236. Xthe alarm message.  To give you an opportunity to carry on after the alarm has
  1237. Xtriggered and be late anyway,
  1238. X.I xalarm
  1239. Xallows you to snooze the alarm.
  1240. X.SH SETTING THE ALARM
  1241. XIf no time is specified,
  1242. X.I xalarm
  1243. Xwill pop up a window in order for an alarm time to be entered.  This form is
  1244. Xsuitable for inclusion as a menu option under a window manager.
  1245. X
  1246. XThe window is also popped up if an invalid alarm or warning time is given
  1247. X(see below for time syntax), or if you specify that confirmation should be
  1248. Xsought before setting the alarm.
  1249. X
  1250. XThe window gives you an opportunity to change the alarm setting, warning times,
  1251. Xand the message
  1252. X.I xalarm
  1253. Xwill display when the alarm is triggered.
  1254. X
  1255. XThe popup resizes itself to
  1256. Xedit any message larger than the space given by default.  The keymap used by
  1257. Xthe Athena Dialog widget is modelled on the text buffer keymap of the
  1258. Xeditor/environment
  1259. X.I emacs(1),
  1260. Xwhile text may be entered when the pointer is anywhere within the popup.
  1261. X
  1262. XThis popup window comprises of three separate windows, dealing with the alarm
  1263. Xtime, the warning time(s) and confirmation of all the settings (where you can
  1264. Xalso re-edit the alarm message).  If the window is popped up, then you can
  1265. Xre-edit the alarm time or warning time(s) by switching through the windows
  1266. Xusing the
  1267. X.I edit
  1268. Xbuttons.  Confirmation of a window's settings is made using the
  1269. X.I enter
  1270. Xbuttons, and the translations resource is set so that the
  1271. X.I return
  1272. Xkey will do the same thing.  If confirmation is not enabled, then the
  1273. Xwindow for confirmation of all settings will not be popped up even if the other
  1274. Xwindows are.
  1275. X
  1276. XAlso see the examples section.
  1277. X.SH USING AN ALARM FILE
  1278. XYou can make
  1279. X.I xalarm
  1280. Xlook for alarm times and messages in an alarm file.  This form is suitable for
  1281. Xinclusion in your
  1282. X.I X
  1283. Xstart up or initialisation  script.
  1284. X
  1285. XIf the environment
  1286. Xvariable
  1287. X.I XALARM
  1288. Xis set, it is assumed to be the name of the file to read from.  If it is not
  1289. Xabsolute, it is assumed to be relative to your home directory.  Otherwise,
  1290. X.I xalarm
  1291. Xtries
  1292. X.I .xalarm
  1293. Xin your home directory.
  1294. X
  1295. XEach line in the file should consist of the date the alarm is to trigger,
  1296. Xoptionally followed the by time and/or message.  If they are present, they must
  1297. Xbe separated from the date by a `-' on its own.  If both are given, the time
  1298. Xmust come first, but if no time is specified, the alarm will trigger
  1299. Ximmediately.
  1300. X
  1301. XThe date is in the form of that given by
  1302. X.I date(1),
  1303. X(day of week, month, day of month) but can be in any order and case is not
  1304. Xsignificant.  If any is omitted, it is assumed to correspond to today.  The
  1305. Xmonth and day of the week must consist of at least the first 3 characters of
  1306. Xthe name.
  1307. X
  1308. XAny line beginning with `#' or `!' is ignored, so this can be used to insert
  1309. Xcomments in the alarm file.
  1310. X
  1311. XAll other command line options and resources still apply.  Also see the
  1312. Xexamples section.
  1313. X.SH TIMES
  1314. XThe time format is quite flexible and natural.  The definition is that
  1315. Xfor times given with 3 or 4 digits,
  1316. Xthe last 2
  1317. Xdigits are always assumed to be minutes.
  1318. XAbsolute times may be suffixed with `am' or `pm', and are assumed to be in
  1319. Xhours if given with 1 or 2 digits.
  1320. XTimes relative to the present time must be prefixed by a `+', and are assumed
  1321. Xto be in minutes if given with 1 or 2 digits.
  1322. XThe hours and minutes can be separated with a `:', `.' or `-'.
  1323. XThe format is a super-set (by far) of the format recognised by
  1324. X.I leave(1).
  1325. XAlso see the examples section.
  1326. X.SH SNOOZING THE ALARM
  1327. XSnoozing is done by selecting a time to snooze using the
  1328. X.I +mins
  1329. Xbuttons (they can be pressed as often as necessary) and pressing the 
  1330. X.I snooze
  1331. Xbutton.  The snooze time may be zeroed by clicking on the
  1332. X.I snoozetime
  1333. Xbutton (it has these two functions; display and zero).  For the really lazy,
  1334. Xthe initial value of
  1335. X.I snoozetime
  1336. Xcan be set by either a command line option or by its resource.
  1337. X.SH MORE ON XALARM
  1338. XYou can also specify that a number of words from the alarm message should be
  1339. Xdisplayed with any warnings, in case you've forgotten what you set it for.  If
  1340. Xnone are to be used, the warning will only indicate when the alarm is due.
  1341. X
  1342. XEven after you have set the alarm and confirmed it, you can reset the alarm
  1343. Xas long as you know the
  1344. X.I xalarm
  1345. Xprocess number.  This can be found by using the
  1346. Xcommand line option to list process numbers, or
  1347. X.I ps(1).
  1348. X
  1349. X.I xalarm
  1350. Xmakes maximum use of resources, as well as having a number of command
  1351. Xline options, and these can be used to control most of the appearance of
  1352. X.I xalarm
  1353. Xand (just about) all of its behaviour.  Both command line options and useful
  1354. Xresources are listed below.
  1355. X
  1356. XWhen
  1357. X.I xalarm
  1358. Xis invoked it immediately attempts to fork off a child and exit itself, leaving
  1359. Xthe child to continue with the alarm.  The child disappears when the X session
  1360. Xon which display 
  1361. X.I xalarm
  1362. Xis using is terminated.
  1363. X
  1364. XYou can exit from
  1365. X.I xalarm
  1366. Xat any time by pressing the available
  1367. X.I quit
  1368. Xbutton.
  1369. X.SH XMEMO, XFORTUNE & XYOW
  1370. X
  1371. XIn reality,
  1372. X.I xmemo
  1373. Xis just a front end to
  1374. X.I xalarm
  1375. X(implemented as
  1376. X.I xalarm -time +0 -nowarn),
  1377. Xwhile
  1378. X.I xfortune
  1379. Xand
  1380. X.I xyow
  1381. Xare front ends to
  1382. X.I xmemo
  1383. X(implemented as
  1384. X.I xmemo \fI"\fP`fortune`\fI"\fP
  1385. Xetc.).
  1386. XOptions supplied to them on the command line still override these defaults,
  1387. Xhowever.
  1388. X.PP
  1389. XNote that
  1390. X.I xfortune
  1391. Xand
  1392. X.I xyow
  1393. Xrequire
  1394. X.I fortune(6)
  1395. Xand
  1396. X.I yow(6)
  1397. Xrespectively -
  1398. X.I yow(6)
  1399. Xcomes with
  1400. X.I emacs(1).
  1401. XAlso note that since they are front ends to
  1402. X.I xmemo,
  1403. Xyou can actually give extra message text to include on the command line.  If
  1404. Xyou specify a time in the future, you can edit the message text when asked to
  1405. Xconfirm (if enabled).
  1406. X.SH OPTIONS
  1407. X.I xalarm
  1408. Xaccepts all of the standard X Toolkit command line options along with the
  1409. Xadditional options listed below:
  1410. X.TP 8
  1411. X.B \-h[elp]
  1412. XPrint a (possibly) helpful usage message.
  1413. X.TP 8
  1414. X.B \-v[ersion]
  1415. XPrint out the version number of
  1416. X.I xalarm
  1417. Xin the form
  1418. X.I version.patchlevel.
  1419. X.TP 8
  1420. X.B \-appointments
  1421. XThis option makes
  1422. X.I xalarm
  1423. Xread alarm times from a file.  Each line in the file should consist of a date
  1424. Xand optional time and/or message.  If the date specified at the beginning of
  1425. Xthe line is today and the time has not passed, then the time is used to set an
  1426. Xalarm.  Note that this must be given as the first option on the command line.
  1427. X.TP 8
  1428. X.B \-t[ime] \fItime\fP
  1429. XThis option indicates at what time the alarm is to be triggered.  Times
  1430. Xrelative to the present must be preceded with a `+', absolute times may end
  1431. Xwith `am' or `pm'.
  1432. X.TP 8
  1433. X.B \-w[arn] \fItime[,time...]\fP
  1434. XIndicate the time(s) before the alarm is due to trigger when a warning should
  1435. Xbe given.  They need not be in any particular order, and should be in the same
  1436. Xformat as for relative times, as above, but without the preceding `+'.  Note that
  1437. Xmultiple times must be separated by commas but without any spaces.
  1438. X.TP 8
  1439. X.B \-c[onfirm]
  1440. XThis option overrides the resource value and forces
  1441. X.I xalarm
  1442. Xto ask for confirmation, unless the alarm is due to trigger immediately.
  1443. X.TP 8
  1444. X.B \-warnwords [\-ww] \fInumber of words\fP
  1445. XIndicate the number of words from the alarm message you wish to display with
  1446. Xthe warning.
  1447. X.TP 8
  1448. X.B \-l[ist]
  1449. XList the process numbers of any
  1450. X.I xalarm
  1451. Xprocesses running on the current host.  Note that this lists what
  1452. X.I ps(1)
  1453. Xthinks are
  1454. X.I xalarm
  1455. Xprocesses, and only on the current host.
  1456. X.TP 8
  1457. X.B \-r[eset] \fIpid\fP
  1458. XSend a signal to the process number
  1459. X.I pid.
  1460. XIf the process is an
  1461. X.I xalarm,
  1462. Xit will pop up the confirmation window to allow you to re-edit the alarm
  1463. Xsettings.
  1464. X.TP 8
  1465. X.B \-s[nooze] \fItime\fP
  1466. XIndicate the time that
  1467. X.I snoozetime
  1468. Xshould initially have when the alarm triggers. It should be in the same format
  1469. Xas for relative times, but without the preceding `+'.
  1470. X.TP 8
  1471. X.B \-nowarn [\-nw]
  1472. XThis option overrides the resource value and forces
  1473. X.I xalarm
  1474. Xnot to give any warnings.  This is the same as setting the warning times
  1475. Xresource to the empty string.
  1476. X.TP 8
  1477. X.B \-noconfirm [\-nc]
  1478. XAs above, but prevents any confirmation being sought.
  1479. X.TP 8
  1480. X.B \-nowarnwords [\-noww]
  1481. XThis option overrides the resource value and forces
  1482. X.I xalarm
  1483. Xnot to display any of the alarm text with any warnings.  This is the same
  1484. Xas setting the warningwords resource to zero.
  1485. X.TP 8
  1486. X.B \-bell \-beep \-b
  1487. XThese options override the resource value and force
  1488. X.I xalarm
  1489. Xto ring the terminal bell when any warnings and the alarm trigger.
  1490. X.TP 8
  1491. X.B \-nobell \-nobeep \-nb
  1492. XAs above, but prevents any warnings and the alarm ringing the bell when they
  1493. Xtrigger.
  1494. X.TP 8
  1495. X.B \fImessage_text\fP
  1496. XThe remaining unrecognised text is used as the message displayed with the
  1497. Xtriggering of the alarm.  Note that each separate argument is assumed to be a
  1498. Xsingle line, so words must be quoted if they are to appear on the same line.
  1499. XFor example:
  1500. X.TP 8
  1501. X            % \fBxalarm "On one line" Secondline "Third line"\fP
  1502. X
  1503. XIt is a good idea always to use quotes, even when a line is only one word.
  1504. XNewlines within arguments are recognised, so that input from other tools can be
  1505. Xused:
  1506. X.TP 8
  1507. X            % \fBxalarm -time +0 "`fortune -l`"\fR
  1508. X
  1509. XAlso note that 
  1510. X.I xalarm
  1511. Xdeletes its copy of any message given on the command line, so your boss can't
  1512. Xsee what it is by looking at the
  1513. X.I xalarm
  1514. Xprocess.
  1515. X.SH EXAMPLES
  1516. XAn entry in an
  1517. X.I X
  1518. Xinitialisation file, before the window manager is executed, making
  1519. X.I xalarm
  1520. Xcheck the alarm file for today's appointments, asking for confirmation before
  1521. Xeach of the alarms are set, and using up to three words from the alarm message
  1522. Xin any warning message:
  1523. X.PP
  1524. X.nf
  1525. X    xclock &
  1526. X    xbiff &
  1527. X    xalarm -appointments -confirm -warnwords 3 &
  1528. X    exec twm
  1529. X.fi
  1530. X
  1531. XThe alarm file might contain, for example, the lines:
  1532. X
  1533. X.nf
  1534. X    # This is just a comment.
  1535. X    ! So is this.  Format is: date [- [time] [message]]
  1536. X
  1537. X    Wednesday - 12:30pm Football !!!
  1538. X    Sun 29 september - 9pm Drag yourself home.
  1539. X    Oct 4 - Contrib sometime today...
  1540. X.fi
  1541. X
  1542. XSo that every Wednesday I have an alarm set for 12:30pm; on Sunday September 29
  1543. Xthere is an alarm to be set for 9pm; on October 4 the alarm is to trigger
  1544. Xstraight away.
  1545. X.PP
  1546. XA
  1547. X.I twm(1)
  1548. Xwindow manger entry which makes
  1549. X.I xalarm
  1550. Xask for confirmation and ring the terminal bell when any warnings and the alarm
  1551. Xare triggered, and have the snooze time initially set to 5 minutes:
  1552. X.PP
  1553. X.nf
  1554. X    Menu "Utilities" {
  1555. X        ...
  1556. X        "alarm":    f.exec "xalarm -confirm -snooze 5 -beep &"
  1557. X        ...
  1558. X    }
  1559. X.fi
  1560. X.PP
  1561. XTo set an alarm for 5 o'clock in the evening, without the default warnings or
  1562. Xconfirmation, but with the default alarm message:
  1563. X.TP 8
  1564. X    % \fBxalarm -time 5pm -nowarn -noconfirm\fR
  1565. X.PP
  1566. XTo set an alarm for 2 hours in advance, warning 1 minute and 5 minutes before it,
  1567. Xwith a message other than the default:
  1568. X.TP 8
  1569. X    % \fBxalarm -time +2.00 -warn 5,1 "Get off your bottom"\fR
  1570. X.PP
  1571. XTo set an alarm for 4.30 (not specifying am/pm, so it is whichever is first),
  1572. Xwith the default warnings and a message other than the default:
  1573. X.TP 8
  1574. X    % \fBxalarm -time 4:30 "Time to sneak off home!"\fR
  1575. X.PP
  1576. XAssuming that there is only one
  1577. X.I xalarm
  1578. Xrunning, which we want to reset, we first find out its process number, and then
  1579. Xwe can reset it:
  1580. X.nf
  1581. X
  1582. X    % \fBxalarm -list\fR
  1583. X    xalarms: 12345
  1584. X    % \fBxalarm -reset 12345\fR
  1585. X
  1586. X.fi
  1587. XTo put a 2 line message on the display
  1588. X.I foo
  1589. Ximmediately (this will only work if the display
  1590. X.I foo
  1591. Xcan be opened):
  1592. X.TP 8
  1593. X    % \fBxmemo -display foo:0.0 "Bob!" "The bar for lunch?"\fR
  1594. X.PP
  1595. XTo quietly display a fortune at a specific geometry:
  1596. X.TP 8
  1597. X    % \fBxfortune -geometry +10+300 -nobeep\fR
  1598. X.PP
  1599. XTo display a Zippy quote (yow!!!) at a specific geometry in 5 minutes and
  1600. X(characteristically) ring the bell:
  1601. X.TP 8
  1602. X    % \fBxyow -geometry +100+100 -time +5 -beep\fR
  1603. X.SH RESOURCES
  1604. X.PP
  1605. XThe widget structure is as follows:
  1606. X.PP
  1607. X.nf
  1608. X    XAlarm
  1609. X        Alarm!
  1610. X            alarm
  1611. X                buttons
  1612. X                    quit snooze snooze1 snooze5 snooze15 snoozetime
  1613. X                message
  1614. X        When?
  1615. X            when
  1616. X                label value ok toggle quit
  1617. X            warnings
  1618. X                label value ok toggle quit
  1619. X            confirm
  1620. X                label value ok cancel quit
  1621. X        Warning!
  1622. X            warning
  1623. X                dismiss message quit
  1624. X.fi
  1625. X.PP
  1626. XSome example resources are:
  1627. X.PP
  1628. X.nf
  1629. X    ! For some nice colours...
  1630. X    XAlarm*background:            LightYellow
  1631. X    XAlarm*foreground:            IndianRed
  1632. X    XAlarm*Command.background:        IndianRed
  1633. X    XAlarm*Command.foreground:        LightYellow
  1634. X    ! But this is what you normally get...
  1635. X    XAlarm*background:            White
  1636. X    XAlarm*foreground:            Black
  1637. X    XAlarm*Command.background:        Black
  1638. X    XAlarm*Command.foreground:        White
  1639. X
  1640. X    ! Perhaps the most commonly used resources...
  1641. X    XAlarm.bell:                True
  1642. X    XAlarm.confirm:                True
  1643. X    XAlarm.warnings:            5,15
  1644. X    XAlarm.warningwords:            0
  1645. X    XAlarm.snooze:                0
  1646. X    
  1647. X    ! If you want a more compact alarm window, try these...
  1648. X    XAlarm.Alarm!.alarm.buttons.snooze1.fromVert:    quit
  1649. X    ! This will vary depending on button labels & font...
  1650. X    XAlarm.Alarm!.alarm.buttons.snooze1.horizDistance:    -93
  1651. X    XAlarm.Alarm!.alarm.buttons.snooze5.fromVert:    quit
  1652. X    XAlarm.Alarm!.alarm.buttons.snooze15.fromVert:    quit
  1653. X    XAlarm.Alarm!.alarm.buttons.snoozetime.fromHoriz:    snooze
  1654. X
  1655. X    ! Plus, if you want...
  1656. X    XAlarm.Alarm!.alarm.message.fromHoriz:        buttons
  1657. X    ! This will vary depending on button labels & font...
  1658. X    XAlarm.Alarm!.alarm.message.vertDistance:        -33
  1659. X
  1660. X    ! Some other defaults...
  1661. X    XAlarm*font: *-times-bold-r-*-*-14-*
  1662. X    XAlarm.Alarm!.alarm.message.font: *-times-bold-i-*-*-34-*
  1663. X    XAlarm.Alarm!.alarm.background:        Black
  1664. X    XAlarm.Alarm!.alarm.message.label:        Alarm Call!!!
  1665. X    XAlarm.Alarm!.alarm.buttons.quit.label:    Quit
  1666. X    XAlarm.Alarm!.alarm.buttons.snooze.label:    Snooze
  1667. X    XAlarm.Alarm!.alarm.buttons.snooze1.label:    +1 min
  1668. X    XAlarm.Alarm!.alarm.buttons.snooze5.label:    +5 mins
  1669. X    XAlarm.Alarm!.alarm.buttons.snooze15.label:    +15 mins
  1670. X.fi
  1671. X.SH TOOLKIT OPTIONS
  1672. XThe following standard X Toolkit command line arguments are commonly used with 
  1673. X.I xalarm:
  1674. X.TP 8
  1675. X.B \-display \fIdisplay\fP
  1676. XThis option specifies the X server to contact.
  1677. X.TP 8
  1678. X.B \-geometry \fIgeometry\fP
  1679. XThis option specifies the preferred size and position of
  1680. X.I xalarm.
  1681. XIt is a little meaningless to specify a size; it is as large as need be.
  1682. X.TP 8
  1683. X.B \-xrm \fIresourcestring\fP
  1684. XThis option specifies a resource string to be used.  This is especially
  1685. Xuseful for setting resources that do not have separate command line options.
  1686. X.SH ENVIRONMENT
  1687. X.TP 8
  1688. X.B DISPLAY
  1689. Xto get the default host and display number.
  1690. X.TP 8
  1691. X.B XENVIRONMENT
  1692. Xto get the name of a resource file that overrides the global resources
  1693. Xstored in the RESOURCE_MANAGER property.
  1694. X.TP 8
  1695. X.B XALARM
  1696. Xto get the name of the appointments file.  Otherwise, it is assumed to be the
  1697. Xfile
  1698. X.I ~/.xalarm.
  1699. XAny file not given as the full path is assumed to be relative to the home
  1700. Xdirectory.
  1701. X.SH "SEE ALSO"
  1702. XX(1),
  1703. Xleave(1),
  1704. Xemacs(1),
  1705. Xtwm(1),
  1706. Xps(1),
  1707. Xdate(1),
  1708. Xfortune(6),
  1709. Xyow(6)
  1710. X.SH BUGS
  1711. X.TP 8
  1712. X.B Times:
  1713. X
  1714. X.I xalarm
  1715. Xbelieves, and is thus at the mercy of, the system clock.
  1716. X
  1717. XIf the time is relative to the present and confirmation is sought, the alarm
  1718. Xand warnings are set from when the time is confirmed, not from when
  1719. X.I xalarm
  1720. Xwas invoked.
  1721. X
  1722. XThe response when an invalid time or warning time is entered is not
  1723. Xparticularly friendly or helpful.
  1724. X
  1725. XCan't cope with specified times more than 24
  1726. Xhours away.  Can't accept things like:
  1727. X.TP 8
  1728. X            % \fBxalarm -time +70\fR
  1729. X
  1730. X.B
  1731. XIt must be in proper hours and minutes, otherwise things like the following
  1732. Xwould be ambiguous:
  1733. X.TP 8
  1734. X            % \fBxalarm -time +100\fR
  1735. X.B
  1736. X
  1737. XDate checking when reading alarms from the alarm file is pretty rudimentary -
  1738. Xif a date is semantically false but syntactically correct,
  1739. X.I xalarm
  1740. Xwill not notice.
  1741. X
  1742. XOnly times corresponding today's date are checked, even if
  1743. X.I xalarm -appointments
  1744. Xis invoked one minute before midnight.
  1745. X.TP 8
  1746. X.B Editing:
  1747. XThe dialog box uses a subset of the
  1748. X.I emacs(1)
  1749. Xeditor/environment keymap for text buffers (which is certainly not a bug!).
  1750. X
  1751. XHowever, the 
  1752. X.I return
  1753. Xkey event is translated by default into the
  1754. X.I confirm
  1755. Xbutton event, as it is translated similarly in the alarm time and warning
  1756. Xdialog boxes.
  1757. XTo insert a newline, use
  1758. X.I ctrl-m
  1759. X(since under
  1760. X.I emacs(1)
  1761. Xthe
  1762. X.I return
  1763. Xkey is a synonym for
  1764. X.I ctrl-m,
  1765. Xunder
  1766. X.I X
  1767. Xthey generate different events), or just change the relevant resource(s) so
  1768. Xthat
  1769. X.I return
  1770. Xproduces the desired effect.  The resources, followed by the necessary value,
  1771. Xare:
  1772. X.TP 8
  1773. X    XAlarm.When?.when.value.translations
  1774. X    XAlarm.When?.warnings.value.translations
  1775. X    XAlarm.When?.confirm.value.translations
  1776. X
  1777. X                #override <Key>Return: newline()
  1778. X.TP 8
  1779. X.B Resetting:
  1780. XSignalling is implemented very simply, and if the process signalled is not an
  1781. X.I xalarm,
  1782. Xstrange things may occur.  Usually, nothing will happen.
  1783. X.TP 8
  1784. X.B Exiting:
  1785. XNormally desirable,
  1786. X.I xalarm
  1787. Xis killed when the X session on which display it is using is terminated whether
  1788. Xyou like it or not.
  1789. X.TP 8
  1790. X.B Input:
  1791. XDoesn't take input from a pipe etc.
  1792. X.SH COPYRIGHT
  1793. XCopyright 1991, 1992, Simon Marshall.
  1794. X.SH AUTHOR
  1795. XSimon Marshall, PhD Self Defense Group, Dept. of Computer Science, University
  1796. XOf Hull, UK.  S.Marshall@Hull.ac.UK
  1797. X.SH CONTRIBERS
  1798. XMassive thanks have to go to Bill Leonard, Harris Computer Systems Division,
  1799. XFlorida, for harassing me with suggestions for improvements to make
  1800. X.I xalarm
  1801. Xa useful tool and this manual page easier to understand, and Andreas Stolcke,
  1802. XInternational Computer Science Institute, Berkeley, for his help fixing code.
  1803. XWithout both, xalarm would still be pretty much as version 2.
  1804. X
  1805. XThanks also to J Braham Levy, Stefan Haenssgen, Jamie Zawinski, Jason Venner
  1806. Xand Kimmo Suominen for their help with version 3.
  1807. X
  1808. XFor their help and suggestions with previous versions of
  1809. X.I xalarm,
  1810. XI would also like to thank (in no real order) Dave Brooks, Reiner Hammer,
  1811. XJay Lawlor, Janet Anstett, Gordon Freedman, Francois-Regis
  1812. XColin and Jeffrey Mast.  If I've missed anyone, sorry.
  1813. X.SH COMMENTS
  1814. XI'd like some; comments, suggestions, code, bug reports and fixes, etc.  Don't
  1815. Xforget to include which version of
  1816. X.I xalarm
  1817. Xyou are using (from
  1818. X.I xalarm -version),
  1819. Xmachine/OS, X11 release & patch number, window manager etc.
  1820. END_OF_FILE
  1821. if test 19025 -ne `wc -c <'xalarm.man'`; then
  1822.     echo shar: \"'xalarm.man'\" unpacked with wrong size!
  1823. fi
  1824. # end of 'xalarm.man'
  1825. fi
  1826. if test -f 'xmemo' -a "${1}" != "-c" ; then 
  1827.   echo shar: Will not clobber existing file \"'xmemo'\"
  1828. else
  1829. echo shar: Extracting \"'xmemo'\" \(73 characters\)
  1830. sed "s/^X//" >'xmemo' <<'END_OF_FILE'
  1831. X#! /bin/sh
  1832. Xexec xalarm -name xmemo -time +0 -nowarn -noconfirm ${1+"$@"}
  1833. END_OF_FILE
  1834. if test 73 -ne `wc -c <'xmemo'`; then
  1835.     echo shar: \"'xmemo'\" unpacked with wrong size!
  1836. fi
  1837. chmod +x 'xmemo'
  1838. # end of 'xmemo'
  1839. fi
  1840. echo shar: End of archive 1 \(of 3\).
  1841. cp /dev/null ark1isdone
  1842. MISSING=""
  1843. for I in 1 2 3 ; do
  1844.     if test ! -f ark${I}isdone ; then
  1845.     MISSING="${MISSING} ${I}"
  1846.     fi
  1847. done
  1848. if test "${MISSING}" = "" ; then
  1849.     echo You have unpacked all 3 archives.
  1850.     rm -f ark[1-9]isdone
  1851. else
  1852.     echo You still need to unpack the following archives:
  1853.     echo "        " ${MISSING}
  1854. fi
  1855. ##  End of shell archive.
  1856. exit 0
  1857. -- 
  1858. Molecular Simulations, Inc.             mail: dcmartin@msi.com
  1859. 796 N. Pastoria Avenue                  uucp: uunet!dcmartin
  1860. Sunnyvale, California 94086             at&t: 408/522-9236
  1861.