[alt.sources] Xkal 1.13 - Part05/05

ferguson@cs.rochester.edu (George Ferguson) (03/14/91)

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 5 (of 5)."
# Contents:  xkal.man xkal2pcal.c xkal2pcal.man xkal2xremind.c
#   xkal2xremind.man
# Wrapped by ferguson@swan.cs.rochester.edu on Wed Mar 13 13:50:05 1991
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'xkal.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xkal.man'\"
else
echo shar: Extracting \"'xkal.man'\" \(26270 characters\)
sed "s/^X//" >'xkal.man' <<'END_OF_FILE'
X.\"
X.\"	Xkal : Graphical appointment calendar
X.\"
X.\"	George Ferguson, ferguson@cs.rochester.edu,  27 Oct 1990.
X.\"	Version 1.1 - 27 Feb 1991.
X.\"
X.\"	$Id: xkal.man,v 2.2 91/03/13 13:36:09 ferguson Exp $
X.\"
X.TH XKAL 1 "26/10/90"
X.ds ]W U of Rochester
X.SH NAME
Xxkal \- graphical appointment calendar
X.SH SYNOPSIS
X.B xkal
X[X\ Toolkit\ options]
X[-appoints\ filename]
X[-date\ date]
X[-listOnly]
X[-silent]
X[-numMonths\ 1|2|3|12]
X[-[no]exitUsesLevels]
X[-[no]bothShown]
X[-[no]opaqueDates]
X[-[no]dowLabels]
X[-[no]titlebar]
X[-version]
X[-help]
X.SH DESCRIPTION
X.PP
XXkal is a graphical appointment calendar that allows you to maintain
Xmany types of reminders, displays them in several different formats,
Xand allows you to add and edit them. Silent and non-graphic modes are
Xprovided to allow xkal to be used to check for appointments without
Xinteraction.
X.PP
XThe general behaviour of xkal is to display one or more months. Clicking
XButton1 on a particular day displays that day's reminder information,
Xeither next to the month or in a popup window (see the
X.B bothShown
Xresource, below). The reminders can be edited within this window, and
Xchanges are automatically saved when the tool is exited. Changes can be
Xaborted or the appointments can be saved immediately using other actions.
XMost available actions are provided by a set of menuButtons above the month
Xdisplay. Clicking and holding on these buttons displays a menu from which the
Xdesired action can be selected. (See below under Translation Actions for a
Xlist of the actions and ways to customize xkal's behaviour.)
X.PP
XReminders can come from two different sources:
X.B system
Xreminders cannot be edited or deleted;
X.B personal
Xreminders can. See below under OPTIONS, FILE FORMATS, and FILES for more
Xdetails about these files. When appointments conflict (ie. there is more
Xthan one reminder that applies for a given day and time), xkal moves one
Xof them to a different time (see the
X.B rearrangeSilently
Xresource).
X.PP
XEach reminder can have a "criticality level" associated with it, indicating
Xits importance. This is reflected in the month display by shading (on
Xmonochrome displays) or coloring (on color displays) days depending on the
Xtotal criticality of their appointments. Typically, frequent or regular
Xreminders would be given level zero, and only more important or unique
Xreminders would influence the display (although they would all be displayed
Xwhen the day is selected).
X.PP
XDouble-clicking on a reminder will pop up a window in which the entry can
Xbe edited, changing things such as the criticality level as desired. Other
Xfields can also be changed, for example to make the reminder weekly or
Xmonthly rather than for that specific day.
XClicking on the applyButton adds the appointment, the revertButton resets
Xthe text items but does NOT undo the effects of previous "apply"s, the
XdeleteButton deletes any reminders matching the given information exactly,
Xand the dismissButton pops down the window.
X.PP
XXkal is designed to be completely customizable. The section below,
XCUSTOMIZING XKAL, describes the widget hierarchies and other relevant
Xresources to help with this. In particular, the relative positions of most
Xof xkal's main components is completely flexible. This version of xkal
Xalso supports full customization of names for use with languages other than
XEnglish.
X.SH OPTIONS
X.PP
XThe following non-widget resources can be set on the command line as well
Xas in a resource file. As usual, when given on the command line they can be
Xabbreviated to their shortest unique prefix, often the first letter.
XFurthermore, xkal accepts all the standard X Toolkit options.
X.IP "\fB-appoints\fP filename"
XUses the given filename as the name of the personal appointment file.
XThe format of this file is described below under FILE FORMATS. A leading
Xtilde (`~') is expanded to the value of $HOME. The default is `~/.appoints'.
XThis option corresponds to the resource
X.BR personalAppoints .
X.IP "\fB-date\fP date"
XChanges xkal's notion of the current date (usually obtained from the
Xsystem). The date string should be as described below under DATE FORMATS,
Xwith whitespace escaped if given on the command line.
X.IP "\fB-listOnly\fP"
XIf given, then xkal simply lists the appointments and weekly reminders
Xto stdout, and exits without interaction. The exit status is the number of
Xappointments for the day. See also
X.BR exitUsesLevels ,
Xbelow.
X.IP "\fB-silent\fP"
XLike above, but simply sets the exit status and doesn't print anything.
XUseful for checking whether there are any appointments. See also
X.BR -exitUsesLevels ,
Xbelow.
X.IP "\fB-exitUsesLevels\fP"
XIf given, then the exit status returned in
X.B listOnly
Xand
X.B silent
Xmodes is the total of the criticality levels of the day's appointments,
Xrather than the number of them.
X.IP "\fB-noexitUsesLevels\fP"
XThe opposite of
X.BR -exitUsesLevels.
XThe exit status is the number of appointments, rather than their
Xcriticality total. This is the default.
X.IP "\fB-numMonths\fP 1|3|12"
XDetermines whether xkal will start displaying one, three, or twelve months.
XThis can be changed while xkal is running using the
X.B xkal-numMonths()
Xaction described below under Translation Actions. The default is to show one
Xmonth.
X.IP "\fB-bothShown\fP"
XIf given, then the day's appointments are displayed in the main tool
Xwindow, otherwise a popup window is created for them. When a day window is
Xpopped up, it becomes the selected window and subsequent appointment updates
Xare done in it. It can be selected and deselected using the buttons. If no
Xpopup window is selected when a day is clicked on, then a new popup window
Xwill be created. The
X.B Dismiss
Xbutton destroys the popup window. When this option is given (the default), no
Xpopup windows are ever created.
X.IP "\fB-nobothShown\fP"
XThe opposite of
X.BR -bothShown .
X.IP "\fB-opaqueDates\fP"
XIf given, then the numbers in the dayButtons are drawn opaquely, which
Xsome people find easier to read when the day is stippled. This is the
Xdefault.
X.IP "\fB-noopaqueDates\fP"
XThe opposite of
X.BR -opaqueDates .
X.IP "\fB-dowLabels\fP"
XIf given, labels are provided at the top of each column in each month
Xindicating the day of the week.
X.IP "\fB-nodowLabels\fP"
XThe opposite of
X.BR -dowLabels .
XThe default is
X.BR nodowLabels .
X.IP "\fB-titlebar\fP"
XIf true, the titlebar of the main window and any popup day windows is
Xchanged to reflect the selected day. This is the default. This option
Xcorresponds to the resource
X.BR useTitlebar .
X.IP "\fB-notitlebar\fP"
XThe opposite of
X.BR -useTitlebar .
X.IP "\fB-updateInterval\fP mins"
XThe number of minutes between automatic checkpointing (saving) of the
Xappointments. If this is zero, then no automatic checkpointing is done.
XThe default is to checkpoint every five minutes.
X.IP "\fB-version\fP"
XPrints the current version of xkal to stdout and exits.
X.IP "\fB-help\fP"
XPrints the usage message, summarizing these options.
X.SH "CUSTOMIZING XKAL"
X.PP
XXkal has a default set of resources built in. If you wish to customize the
Xtool, take a copy of the default application defaults file (see
XFILES below) and modify it. Then, before invoking xkal, set the environment
Xvariable
X.B XAPPLRESDIR
Xto the directory containing your private copy. Alternatively, you can place
Xentries in your .Xdefaults file or provide them with the -xrm toolkit
Xoption.
X.SH "Other Non-Widget Resources"
X.PP
XThe following resources customize xkal's file operations:
X.IP "\fBsystemAppoints\fP"
XThe file for system (non-editable) reminders. Default is to not have a
Xsystem reminder file.
X.IP "\fBbackupExtension\fP"
XThe suffix used when the personal appointments file is backed up before
Xsaving it. If this is empty then the file is not backed up. The default is
Xto append a tilde (`~').
X.IP "\fBoutputFormat\fP"
XThis resource specifies the desired "canonical" output format. It should
Xbe a string with printf-style escapes that are replaced with parts of the
Xreminder as follows:
X.nf
X.na
X	%w	short form of day of the week
X	%W	long form of day of the week
X	%d	day
X	%m	short form of month
X	%M	long form of month
X	%n	numeric form of month
X	%y	year
X	%Y	year modulo 100
X	%t	time
X	%l	criticality level
X	%~	space iff previous pattern was printed
X	%/	slash iff previous pattern was printed
X.ad
X.fi
XThe default is "%w%~%d%~%m%~%y%~%t%~%l%~". Another possibility might be
X"~%n%/%d%/%Y%~%w%~%t%~%l%~" (see
X.BR daySlashMonth ,
Xbelow).
X.IP "\fBdaySlashMonth\fP"
XThis resource controls how dates with slashes are interpreted. If it is
XTrue, then these dates are interpreted as "day/month" or "day/month/year"
Xrather than the default "mon/day" or "mon/day/year".
X.IP "\fBlevelDelim\fP"
XThis resource specifies the characters that, when encountered while parsing
Xa reminder, indicate its criticality level. If it is one character, then
Xthat character is used for both the opening and the closing delimiter. The
Xdefault is to have the criticality level enclosed in ampersands (`@').
X.IP "\fBdefaultLevel\fP"
XThe default criticality level for newly-created appointments. This can be
Xchanged by editing the appointment. The default is one (`1').
X.PP
XThe following resources customize various aspects of dates:
X.IP "\fBlongDowStrings\fP"
XThis resource should be a whitespace-separated list of seven strings
X(sorry, no escapes for blanks yet) specifying the full names
Xof the days of the week, in order from Sunday to Saturday.
X.IP "\fBshortDowStrings\fP"
XThis resource specifies the seven abbreviated forms of the names of
Xthe days of the week.
X.IP "\fBlongMonthStrings\fP"
XThis resource specifies the twelve full names of the months, in order from
XJanuary to December.
X.IP "\fBshortMonthStrings\fP"
XThis resource specifies the twelve abbreviated forms of the names of the
Xmonths.
X.IP "\fBdowOffset\fP"
XThis resource specifies which day of the week is considered "first",
Xrelative to the lists above. If it is zero (the default), then the first
Xstring ("Sunday") is the first day of the week; if it is one, then the
Xsecond string ("Monday") is first (leftmost in a calendar). This resource
Xmight not be needed as you could probably just rearrange the strings.
X.PP
XThe following resources customize the appearance of the day's reminders:
X.IP "\fBappsStartTime\fP"
XSpecifies the time of the earliest entry for a day. It should be of the
Xform "hours:mins", with optional "am" or "pm" indicator. The "mins" field
X(with colon) is optional. The default is "8:00".
X.IP "\fBappsEndTime\fP"
XSpecifies the time of the latest entry for a day. The default is "17:00".
X.IP "\fBappsIncrement\fP"
XSpecifies the interval between entries. The default is ":30".
X.IP "\fBappsUseAmPm\fP"
XIf True, then reminder slots are labelled in 12-hour (with "am" or "pm")
Xnotation, rather than the default 24-hour form.
X.IP "\fBnumNotes\fP"
XSpecifies the number of entries that are not associated with a time. The
Xdefault is two (`2').
X.IP "\fBnotesLabel\fP"
XSpecifies the label for those entries without a time. The default is
X"NOTES".
X.IP "\fBnoonStr\fP"
XSpecifies the string used for representing 12:00. The default is "Noon".
XWhen
X.B appsUseAmPm
Xis True this string is used to label the appropriate slot. The string
Xis also understood in reminder files (so be careful when changing it or
Xold files written with
X.B appsUseAmPm
XTrue will not be readable).
X.IP "\fBmidnightStr\fP"
XLike
X.B noonStr
Xbut specifies the string used for representing 0:00. The default is "Midnight".
X.IP "\fBrearrangeSilently\fP"
XWhen two or more reminders are specified for the same time (either
Xbecause they are from different files or because one or more is weekly
Xor monthly or whatever), xkal will move some of the reminders to other
Xslots. If this resource is True, then it will do so without indicating it.
XIf False (the default), then it will indicate the original time in square
Xbrackets before the text of the reminder. If there is an reminder for a
Xtime for which there is no slot, then this reminder is moved to the notes
Xsection and labelled as above.
X.PP
XThe following resources control how criticality levels are reflected in the
Xcalendar display. Where bitmaps are to be specified, they can either be
Xabsolute pathnames or else are taken relative to the global resource
X.BR bitmapFilePath .
XSee
X.BR XmuLocateBitmapFile (3X)
Xfor details.
X.IP "\fBnoDayShade\fP"
XSpecifies the bitmap for shading boxes that do not correspond to a day in
Xthat month. These boxes are not selectable, obviously. Default is
X"cross_weave".
X.IP "\fBmaxLevel\fP"
XSpecifies the number of different levels of criticality that can be
Xdisplayed. Levels greater than this use the maximum level. The default is
Xseven (`7').
X.IP "\fBshades\fP"
XThis resource should be a whitespace-separated list of bitmap names. They
Xwill be used with monochrome displays to shade the day appropriately. Days
Xfor which the total reminder criticality is 1 will use the first shade,
Xetc. If fewer than
X.B maxLevel
Xbitmaps are given then the last entry is used for levels for which none was
Xgiven. The default is a series of gray shades.
X.IP "\fBcolors\fP"
XLike
X.BR shades ,
Xbut specifies the colors to be used with color displays. The default is
Xgreen, blue, and yellow for two levels each, then red for the rest.
X.SH "Widget Hierarchy"
X.PP
XXkal uses standard Athena widgets which can be customized as usual.
XSome of the resources used to describe the widgets must be given as
Xnon-widget resources due to problems with the creation/realization order.
XThese are identified below and in the resource file.
XThe widget hierarchy is as follows:
X
X.ta 8,12,16,20,24,28,32,36,40
X.na
X.nf
X	TopLevelShell Xkal
X		Form bothForm
X			MenuButton fileButton,viewButton,otherButton
X			Form allMonthsForm
X			Form dayForm [if \fBbothShown\fP is True]
X.fi
X.ad
X
XThe Form widget
X.B allMonthsForm
Xcontains the months, depending on the value of the
X.B numMonths
Xresource these will be one, three, or twelve Forms named
X.BR monthForm1 ,
X.B monthForm3
Xor
X.BR monthForm12
Xrespectively. This separation of specification allows each type of display
Xto be customized separately. Each monthForm will contain a Label
X.BR MonthLabel X
X(where X is 1, 3, or 12) and Toggles for the days named
X.BR dayButton X.
XIn order to correctly allocate pixmaps, the size of these buttons must be
Xset in the non-widget resources
X.BR dateWidth X
Xand
X.BR dateHeight X,
Xrather than using the width and height resources of the
X.BR dayButton X.
XThe printing of the date in the
X.B dayButton
Xis controlled by the non-widget resources
X.BR dateFont X
Xand
X.BR datePosition X;
Xthis last should be a geometry string of the form `+x+y' taken as an offset
Xfrom the top left corner of the button.
X.PP
XIf
X.B bothShown
Xis not True, then the popup window looks like
X
X.na
X.nf
X	TopLevelShell popupDayShell
X		Form popupDayForm
X			Command dismissButton
X			Command selectButton
X			Command unselectButton
X			Form dayForm
X.fi
X.ad
X.PP
XIn either case, the
X.B dayForm
Xcontains a Label
X.B dayLabel
X(to display the date), and enough instances of pairs of: a Label
X.B appointLabel
Xto display the time of the appointment and an AsciiText
X.B appointText
Xfor displaying and editing the appointment itself. The number of these is
Xof course determined by the resources
X.BR appsStartTime ,
X.BR appsEndTime ,
X.BR appsIncrement ,
Xand the like (see above).
XThe relative positions of these are hard-coded and so cannot be
Xchanged using resources.
X.PP
XXkal provides three menuButtons on the main window, called
X.BR fileButton ,
X.BR viewButton ,
Xand
X.BR otherButton .
XThey are all children of
X.BR bothForm .
XSince
X.B allMonthsForm
Xand
X.B dayForm
X(if
X.B bothShown
Xis True) are also children of
X.BR bothForm ,
Xthe buttons can be placed arbitrarily in the tool. The corresponding
XezMenu widgets
X.BR fileMenu ,
X.BR viewMenu ,
Xand
X.BR otherMenu
Xcan be customized to provide other actions if desired (see
X.BR ezMenu (3)).
X.PP
XWhen the
X.B xkal-edit-appoint()
Xaction is invoked (by default by double-clicking on a reminder or its
Xlabel), a window is popped up to allow the selected reminder
Xto be edited. This widget hierarchy is:
X
X.nf
X.na
X	TopLevelShell editShell
X		Form editForm
X			Command applyButton
X			Command revertButton
X			Command deleteButton
X			Command dismissButton
X			Label,Text dow{Label,Text}
X			Label,Text day{Label,Text}
X			Label,Text mon{Label,Text}
X			Label,Text year{Label,Text}
X			Label,Text time{Label,Text}
X			Label,Text level{Label,Text}
X.ad
X.fi
X
XClicking on the applyButton adds the appointment, the revertButton resets
Xthe text items but does NOT undo the effects of previous "apply"s, the
XdeleteButton deletes any reminders matching the given information exactly,
Xand the dismissButton pops down the window. The effects of these buttons
Xcan be bound to different events using the
X.B notify()
Xaction.
X.PP
XWhen the
X.B xkal-edit-defaults()
Xaction is invoked (by default by selecting "Edit defaults" from the Other
Xmenu), a window is popped up to allow some of the application defaults
Xto be edited. This widget hierarchy is:
X
X.nf
X.na
X	TopLevelShell defaultsShell
X		Form defaultsForm
X			Command applyButton
X			Command revertButton
X			Command dismissButton
X			Label,Text personalAppoints{Label,Text}
X			Label,Text backupExtension{Label,Text}
X			Label,Text date{Label,Text}
X			Label,Text numMonths{Label,Text}
X			Label,Text checkpointInterval{Label,Text}
X			Label,Text rearrangeSilently{Label,Text}
X			Label,Text defaultLevel{Label,Text}
X			Label,Text levelDelim{Label,Text}
X.ad
X.fi
X
XClicking on the applyButton sets the application defaults from the
Xappropriately labelled item, the revertButton resets
Xthe text items but does NOT undo the effects of previous "apply"s,
Xand the dismissButton pops down the window. The effects of these buttons
Xcan be bound to different events using the
X.B notify()
Xaction. There is unfortunately no way to save defaults edited in this
Xway; you have to modify the resource file yourself.
X
X.SH "Translation Actions"
X.PP
XThe following action procedures are registered for xkal and can be bound
Xto widget events using the
X.B translations
Xresource (see the Xt manual, Appendix C). Certain actions are hard-coded
Xto widgets (for example, setting the dayForm when a dayButton is
Xclicked on) since they are so essential to correct behaviour. They can be
Xbound to different events using the
X.B notify()
Xaction.
X.IP \fBxkal-quit()\fP
XUpdate the appointments file, destroy the tool, and exit with status 0.
XBy default this is performed by selecting
X.B Quit
Xfrom the File menu, or typing `q' in a dayButton.
X.IP \fBxkal-exit()\fP
XDestroy the tool and exit without saving any changes to the
Xappointments file. By default this is bound to selecting
X.B Exit
Xfrom the File menu, and to `x' in the dayButtons.
X.IP \fBxkal-save()\fP
XUpdates the appointments file, saving any changes. By default, this is
Xinvoked by the
X.B Save
Xentry of the File menu, or by typing `s'. See also the resources
X.B backupExtension
Xand
X.BR checkpointInterval .
X.IP \fBxkal-next()\fP
XIf
X.B numMonths
Xis 1 or 3, this action will move the month display ahead to the next month.
XIf
X.B numMonths
Xis 12, it will move to the next year. By default this is provided by the
X.B Next
Xentry of the View menu, or by typing `n' in the dayButtons.
X.IP \fBxkal-prev()\fP
XLike above, but moves back one month or year. By default this is provided
Xby the
X.B Prev
Xentry of the View menu, and by typing `p'.
X.IP \fBxkal-today()\fP
XSelects the current date. Note that this can be altered by the
X.B -date
Xflag or set using the defaults editor.
XBy default this is available from the View menu or by typing `t'.
XNote that if xkal's notion of the current date comes form the system (ie.
Xwas not given by the
X.B date
Xresource) then it will recheck the current system date whenever this action
Xis invoked, in case it has been running for a long time.
X.IP \fBxkal-numMonths(\fPnum\fB)\fP
XSet the month display to 1, 3, or 12, depending on the value of `num'.
XThis is provided by default by the three appropriately entries of the
XView menu, and by typing `1', `3', and `12' (ie. `1' then `2' "fast enough")
Xrespectively.
X.IP \fBxkal-edit-appoint()\fP
XThis action should be bound to either an appointLabel or an appointText
Xwidget. It pops up the reminder editor (if it is not already up) and sets
Xthe text items in it from the current appointment. See the description of
Xits widget hierarchy above for details of how the editor works. By default
Xthis is bound to double-clicking on an appointLabel or appointText.
X.IP \fBxkal-edit-defaults()\fP
XPops up the defaults editor (if it is not already up).
XSee the description of its widget hierarchy above for details of how the
Xeditor works. By default this is available from the Other menu or by typing
X`e' in a dayButton.
X.IP \fBxkal-system(\fPcmd\fB)\fP
XThis action provides a general escape mechanism. The argument will be
Xpassed to the shell for execution using
X.BR system (3).
XYou might use this, for example, to automatically run a filter over your
Xappointment file every time it is saved. To do this, replace any translations
Xusing
X.B xkal-save()
Xwith
X
X.ce 1
X.BR xkal-save() , xkal-system( script ).
X
XYou could also provide additional escapes on the Other menu, or even pop up
Xan xterm to do something more long-lived. By default, the Other menu's
X"Help" item pops up an xterm with this man page using this action.
X.SH "FILE FORMAT"
X.PP
XXkal understands almost any kind of date in its appointment files.
XReminders consist of the date, time, and level specifiers, followed by
Xthe text of the reminder, one reminder per line. Fields should be separated
Xby whitespace. Leading whitespace and lines beginning with `#' are ignored
Xwith the exception that is a line is of the form
X
X.nf
X.na
X	#include filename
X.ad
X.fi
X
Xthen xkal reads the specified file (no quotes or brackets, filename taken
Xto end-of-line) at that point.
X.PP
XThe following specifiers are understood; the text of the reminder is
Xassumed to start when none of these apply (so be careful about reminders
Xthat start with numbers). In the following table `#' indicates a string of
Xdigits:
X
X.ta 8,16,24,32,40
X.na
X.nf
X	#:#	=	hours:mins (24hr)
X	#:#	=	hours:mins (24hr)
X	#:#am	=	hours:mins
X	#:#pm	=	hours+12:mins
X	#/#	=	month/day (depends on \fBdaySlashMonth\fP)
X	#/#/#	=	month/day/year ("   "        "     )
X	#am	=	hours
X	#pm	=	hours (+12)
X	# <= 31	=	day
X	# > 31	=	year
X	@#@	=	level (depends on \fBlevelDelim\fP)
X.fi
X.ad
X
XIn addition, either long or short forms of the days of the week or of
Xthe months are understood (see
X.BR longDowStrings ,
Xetc.).
X.PP
XAny of the fields can be omitted from a reminder's date. The decision as to
Xwhether a reminder applies to a particular day is made using the following
X(hopefully intuitive) algorithm:
X.IP -
XIf no time is given for the reminder, then it is taken to belong in
Xthe Notes section.
X.IP -
XIf the reminder does not specify a day of the week, then the day, month,
Xand year must match if given, otherwise they are assumed to match. For
Xexample:
X.na
X.nf
X	25 Dec Christmas of every year
X	Nov 13 1991 My 26th birthday
X	Mar Every day in March
X	1 The first day of every month
X.fi
X.ad
X.IP -
XIf the reminder specifies a day of the week but no day, the the day of the
Xweek of the day in question must match, and the month and year must match
Xif given. For example:
X.na
X.nf
X	Wed 11:00 My weekly Wednesday meeting
X	Fri Mar 1991 Every Friday in March, 1991
X.fi
X.ad
X.IP -
XIf both a day of the week and a day are given, then the interpretation is
X"the first day of the week on or after the given day". For example
X(assuming the actual calendar):
X.na
X.nf
X	Wed 1 February 1991 This matches Feb 6, 1991
X	Fri 14 1991 Matches Jan 18, Feb 15, Mar 15, ...
X.fi
X.ad
X.PP
XAlthough this is not totally flexible, it is hoped that it will cover the
Xvast majority of cases efficiently (since the algorithm must be performed
Xoften during execution).
X
X.SH "DATE FORMAT"
X.PP
XWhen using the
X.B date
Xresource to change xkal's notion of the current date, the value of the
Xresource can be either an absolute or a relative date, as follows.
X.IP -
XA relative date begins with either `+' or `-' followed by any
Xamount of `number'`specifer' pairs where `specifier' is one of
X`d', `m', or `y' indicating days, months, and years respectively.
XXkal's current date is set to the current system date offset by the relative
Xdate. For example:
X
X	% xkal -listOnly -date +1d
X
Xwould list tomorrow's reminders, and
X
X	% xkal -date +1d1y
X
Xwould start interaction at the day one year from tomorrow. If a number without
Xa specifier terminates a date, the specifier is taken to be `d' (so `+1' is the
Xsame as `+1d').
X.IP -
XAn absolute date is specified by giving any of the day, month, or year desired,
Xusing the same formats as for appointment files (see above). Note that
Xyears less than 1900 have no meaning in UNIX and years less than 1970 will
Xconfuse the system time routines. Thus
X
X	% xkal -date 25Dec\ \ and\ \ % xkal -date Dec25
X
Xspecify Christmas of the current year,
X
X	% xkal -date 'Dec 1925'
X
Xspecifies today's day in December of 1925, and
X
X	% xkal -date 25Dec1925
X
Xspecifies Christmas Day, 1925. Note that spaces are allowed within a date
Xbut must be escaped from the shell if given on the command line.
X.SH ENVIRONMENT
X.PP
XXAPPLRESDIR	- Directory containing xkal resource file
X.SH FILES
X.PP
X.nf
X.na
X~/.appoints		- default appointment file
X$LIBDIR/xkal.appoints	- default system appintment file
X$XAPPLRESDIR/Xkal	- default xkal resource file
X.ad
X.fi
X.SH DIAGNOSTICS
X.PP
XXkal complains about incorrectly formatted appoinment entries, specifying
Xthe exact location of the error. These messages go to stderr.
X.PP
XOther error messages will either result in popup windows or messages to
Xstandard error.
X.SH "SEE ALSO"
X.PP
XX(1),
Xkal(1),
Xcal(1),
Xcalend(1),
Xcalendar(1).
X.SH BUGS
X.PP
XXkal will not think the appointments have changed unless a key has been
Xpressed in one of the appointText widgets. Thus, pasting a selection into
Xone of these will work, but you will have to hit a key (eg. Return) before
Xattempting to save or switch days.
X.PP
XWhen invoked in one of the non-interactive modes, a custom resource parser
Xis used to avoid opening an X connection. This parser does not understand
Xthe "-xrm" resource specifiers. This should not be a problem since all
Xresources relevant to these modes can be specified with command line
Xoptions instead.
X.SH AUTHOR
X.PP
XGeorge Ferguson, University of Rochester
X.br
X(ferguson@cs.rochester.edu)
END_OF_FILE
if test 26270 -ne `wc -c <'xkal.man'`; then
    echo shar: \"'xkal.man'\" unpacked with wrong size!
fi
# end of 'xkal.man'
fi
if test -f 'xkal2pcal.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xkal2pcal.c'\"
else
echo shar: Extracting \"'xkal2pcal.c'\" \(2431 characters\)
sed "s/^X//" >'xkal2pcal.c' <<'END_OF_FILE'
X/*
X *	xkal2pcal.c : Prints yearly or one-shot reminders in pcal format.
X *		Output to given file or ~/.calendar.
X *
X *	George Ferguson, ferguson@cs.rochester.edu,  19 Feb 1991.
X *
X *	$Id: xkal2pcal.c,v 1.1 91/02/28 11:21:46 ferguson Exp $
X *
X */
X#ifndef lint
Xstatic char rcs_id[] = "$Id: xkal2pcal.c,v 1.1 91/02/28 11:21:46 ferguson Exp $";
X#endif
X#include <stdio.h>
X#include <X11/Intrinsic.h>
X#include "app-resources.h"
X#include "db.h"
X#include "date-strings.h"
Xextern char *getenv();
Xextern int errno;
X
X/*
X * Functions declared in this file
X */
Xint main();
Xstatic void syntax();
X
X/*
X * Data declared in this file
X */
Xchar *program;
XAppResources appResources;
Xint appointsChanged = False;		/* need this for linkage */
X
X/*	-	-	-	-	-	-	-	-	*/
X
Xint
Xmain(argc, argv)
Xint argc;
Xchar **argv;
X{
X    FILE *fp;
X    char *s,output[1024];		/* how big shall we be? */
X    int dow,err;
X    Yearrec *yp;
X    Monrec *mp;
X    Dayrec *dp;
X    Msgrec *xp;
X
X    program = *argv;
X    XtToolkitInitialize();	/* gotta have this, although no display */
X    getResources(&argc,argv);
X    if (argc == 2) {
X	strcpy(output,argv[1]);
X    } else if (argc == 1) {
X	strcpy(output,"");
X	if ((s=getenv("HOME")) != NULL) {
X	    strcpy(output,s);
X	    strcat(output,"/");
X	}
X	strcat(output,".calendar");
X    } else {
X	exit(1);
X    }
X    initDb();
X    initDateStrings();
X    if (appResources.systemAppoints && *appResources.systemAppoints)
X	readDb(appResources.systemAppoints,True);
X    if (appResources.personalAppoints && *appResources.personalAppoints)
X	readDb(appResources.personalAppoints,False);
X    appResources.outputFormat = "%m %d %y%~%t ";
X    if (strcmp(output,"-") == 0) {
X	fp = stdout;
X    } else if ((fp=fopen(output,"w")) == NULL) {
X	err = errno;
X	fprintf(stderr,"%s: ",program);
X	errno = err;
X	perror(output);
X	exit(1);
X    }
X    for (yp = Db[dow]; yp != NULL; yp = yp->next)
X	for (mp = yp->mons; mp != NULL; mp = mp->next)
X	    for (dp = mp->days; dp != NULL; dp = dp->next)
X		for (xp = dp->msgs; xp != NULL; xp = xp->next)
X		    if (xp->month && xp->day)
X			writeAppoint(fp,xp);
X    fclose(fp);
X    exit(0);
X}
X
X#ifdef USE_ALERT
X/*
X * alert() : This function is defined so that db.c will link happily,
X *	although it will never be called since xkal2pcal runs in non-
X *	interactive mode.
X */
X/*VARARGS*/
Xvoid
Xalert()
X{
X    /* notused */
X}
X#endif
X
Xstatic void
Xsyntax()
X{
X    fprintf(stderr,"usage: %s [file]  (default is ~/.calendar)\n",program);
X}
END_OF_FILE
if test 2431 -ne `wc -c <'xkal2pcal.c'`; then
    echo shar: \"'xkal2pcal.c'\" unpacked with wrong size!
fi
# end of 'xkal2pcal.c'
fi
if test -f 'xkal2pcal.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xkal2pcal.man'\"
else
echo shar: Extracting \"'xkal2pcal.man'\" \(1188 characters\)
sed "s/^X//" >'xkal2pcal.man' <<'END_OF_FILE'
X.\"
X.\"	xkal2pcal : Convert xkal files to pcal format
X.\"
X.\"	George Ferguson, ferguson@cs.rochester.edu,  20 Feb 1991.
X.\"
X.\"	$Id: xkal2pcal.man,v 1.1 91/02/28 11:22:03 ferguson Exp $
X.\"
X.TH XKAL2PCAL 1 "20/2/91"
X.ds ]W U of Rochester
X.SH NAME
Xxkal2pcal \- convert xkal files to pcal format
X.SH SYNOPSIS
X.B xkal2pcal
X[-a appoints]
X[output file]
X.SH DESCRIPTION
X.PP
XXkal2pcal converts
X.BR xkal (1)
Xreminder files to
X.BR pcal (1)
Xformat and writes them to either the filename given on the command line, or
Xto ~/.calendar by default. Only yearly or one-shot reminders are written
Xsince these are the only type of date specifiers
X.B pcal
Xunderstands. Both the system and personal reminder files are used for the
Xconversion.
X.PP
XThe
X.B xkal
X"\c
X.B -a
Xappoints"
Xoption can be given on the command line to change the personal reminders
Xfile. The filename "-" can be given to force output to stdout.
X.SH FILES
X.PP
X.nf
X.na
X~/.appoints			- default appointment file
X$LIBDIR/xkal.appoints	- default system appintment file
X~/.calendar			- default output file
X.ad
X.fi
X.SH "SEE ALSO"
X.PP
XX(1),
Xpcal(1).
Xxkal(1).
X.SH AUTHOR
X.PP
XGeorge Ferguson, University of Rochester
X.br
X(ferguson@cs.rochester.edu)
END_OF_FILE
if test 1188 -ne `wc -c <'xkal2pcal.man'`; then
    echo shar: \"'xkal2pcal.man'\" unpacked with wrong size!
fi
# end of 'xkal2pcal.man'
fi
if test -f 'xkal2xremind.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xkal2xremind.c'\"
else
echo shar: Extracting \"'xkal2xremind.c'\" \(2906 characters\)
sed "s/^X//" >'xkal2xremind.c' <<'END_OF_FILE'
X/*
X *	xkal2xremind.c : Prints weekly or one-shot reminders in xremind
X *		format, minus 5 minutes from the scheduled time. Output
X *		to given file or ~/.xremind.
X *
X *	George Ferguson, ferguson@cs.rochester.edu,  19 Feb 1991.
X *
X *	$Id: xkal2xremind.c,v 1.2 91/03/13 13:31:51 ferguson Exp $
X *
X */
X#ifndef lint
Xstatic char rcs_id[] = "$Id: xkal2xremind.c,v 1.2 91/03/13 13:31:51 ferguson Exp $";
X#endif
X#include <stdio.h>
X#include <X11/Intrinsic.h>
X#include "app-resources.h"
X#include "db.h"
X#include "date-strings.h"
Xextern char *getenv();
Xextern int errno;
X
X/*
X * Functions declared in this file
X */
Xint main();
Xstatic void syntax();
X
X/*
X * Data declared in this file
X */
Xchar *program;
XAppResources appResources;
Xint appointsChanged = False;		/* need this for linkage */
X
X/*	-	-	-	-	-	-	-	-	*/
X
Xint
Xmain(argc, argv)
Xint argc;
Xchar **argv;
X{
X    FILE *fp;
X    char *s,output[1024];		/* how big shall we be? */
X    int dow,err;
X    Yearrec *yp;
X    Monrec *mp;
X    Dayrec *dp;
X    Msgrec *xp;
X
X    program = *argv;
X    XtToolkitInitialize();	/* gotta have this, although no display */
X    getResources(&argc,argv);
X    if (argc == 2) {
X	strcpy(output,argv[1]);
X    } else if (argc == 1) {
X	strcpy(output,"");
X	if ((s=getenv("HOME")) != NULL) {
X	    strcpy(output,s);
X	    strcat(output,"/");
X	}
X	strcat(output,".xremind");
X    } else {
X	exit(1);
X    }
X    initDb();
X    initDateStrings();
X    if (appResources.systemAppoints && *appResources.systemAppoints)
X	readDb(appResources.systemAppoints,True);
X    if (appResources.personalAppoints && *appResources.personalAppoints)
X	readDb(appResources.personalAppoints,False);
X    appResources.outputFormat = "%n%/%d%/%Y%w %t ";
X    if (strcmp(output,"-") == 0) {
X	fp = stdout;
X    } else if ((fp=fopen(output,"w")) == NULL) {
X	err = errno;
X	fprintf(stderr,"%s: ",program);
X	errno = err;
X	perror(output);
X	exit(1);
X    }
X    for (dow = 0; dow < 8; dow++)
X      for (yp = Db[dow]; yp != NULL; yp = yp->next)
X	for (mp = yp->mons; mp != NULL; mp = mp->next)
X	    for (dp = mp->days; dp != NULL; dp = dp->next)
X		for (xp = dp->msgs; xp != NULL; xp = xp->next)
X		    if (((!dow && xp->year && xp->month && xp->day) ||
X		    	 (dow && !xp->year && !xp->month && !xp->day)) &&
X			xp->hour != -1) {
X			if (xp->hour == 0) {
X			    xp->mins = 55;
X			    xp->hour = 23;
X			} else if (xp->mins == -1) {
X			    xp->mins = 55;
X			    xp->hour -= 1;
X			} else if (xp->mins < 5) {
X			    xp->mins = 55 + xp->mins;
X			    xp->hour -= 1;
X			} else {
X			    xp->mins -= 5;
X			}
X			writeAppoint(fp,xp);
X		    }
X    fclose(fp);
X    exit(0);
X}
X
X#ifdef USE_ALERT
X/*
X * alert() : This function is defined so that db.c will link happily,
X *	although it will never be called since xkal2xremind runs in non-
X *	interactive mode.
X */
X/*VARARGS*/
Xvoid
Xalert()
X{
X    /* notused */
X}
X#endif
X
Xstatic void
Xsyntax()
X{
X    fprintf(stderr,"usage: %s [file]  (default is ~/.xremind)\n",program);
X}
END_OF_FILE
if test 2906 -ne `wc -c <'xkal2xremind.c'`; then
    echo shar: \"'xkal2xremind.c'\" unpacked with wrong size!
fi
# end of 'xkal2xremind.c'
fi
if test -f 'xkal2xremind.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xkal2xremind.man'\"
else
echo shar: Extracting \"'xkal2xremind.man'\" \(1219 characters\)
sed "s/^X//" >'xkal2xremind.man' <<'END_OF_FILE'
X.\"
X.\"	xkal2xremind : Convert xkal files to xremind format
X.\"
X.\"	George Ferguson, ferguson@cs.rochester.edu,  20 Feb 1991.
X.\"
X.\"	$Id: xkal2xremind.man,v 1.1 91/02/28 11:22:05 ferguson Exp $
X.\"
X.TH XKAL2XREMIND 1 "20/2/91"
X.ds ]W U of Rochester
X.SH NAME
Xxkal2xremind \- convert xkal files to xremind format
X.SH SYNOPSIS
X.B xkal2xremind
X[-a appoints]
X[output file]
X.SH DESCRIPTION
X.PP
XXkal2xremind converts
X.BR xkal (1)
Xreminder files to
X.BR xremind (1)
Xformat and writes them to either the filename given on the command line, or
Xto ~/.xremind by default. Only weekly or one-shot reminders are written
Xsince these are the only type of date specifiers
X.B xremind
Xunderstands. Both the system and personal reminder files are used for the
Xconversion.
X.PP
XThe
X.B xkal
X"\c
X.B -a
Xappoints"
Xoption can be given on the command line to change the personal reminders
Xfile. The filename "-" can be given to force output to stdout.
X.SH FILES
X.PP
X.nf
X.na
X~/.appoints			- default appointment file
X$LIBDIR/xkal.appoints	- default system appintment file
X~/.xremind			- default output file
X.ad
X.fi
X.SH "SEE ALSO"
X.PP
XX(1),
Xxremind(1).
Xxkal(1).
X.SH AUTHOR
X.PP
XGeorge Ferguson, University of Rochester
X.br
X(ferguson@cs.rochester.edu)
END_OF_FILE
if test 1219 -ne `wc -c <'xkal2xremind.man'`; then
    echo shar: \"'xkal2xremind.man'\" unpacked with wrong size!
fi
# end of 'xkal2xremind.man'
fi
echo shar: End of archive 5 \(of 5\).
cp /dev/null ark5isdone
MISSING=""
for I in 1 2 3 4 5 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 5 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

-- 
George Ferguson			ARPA: ferguson@cs.rochester.edu
University of Rochester		UUCP: {decvax,rutgers}!rochester!ferguson
Rochester  NY  14627-0226	VOX:  (716) 275-2527