home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / xcalplus / part01 < prev    next >
Encoding:
Text File  |  1993-03-02  |  22.3 KB  |  743 lines

  1. Newsgroups: comp.sources.misc
  2. From: ekatz@rels.ncsa.uiuc.edu (Eric Katz)
  3. Subject: v35i108:  xcalendar+ - XCalendar tool, Part01/01
  4. Message-ID: <1993Mar3.155948.14936@sparky.imd.sterling.com>
  5. X-Md4-Signature: a37ec179aa51233772dc0711b54a2649
  6. Date: Wed, 3 Mar 1993 15:59:48 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: ekatz@rels.ncsa.uiuc.edu (Eric Katz)
  10. Posting-number: Volume 35, Issue 108
  11. Archive-name: xcalendar+/part01
  12. Environment: Perl, X11
  13.  
  14. This is a program that I wrote and have been using for about 1 year.  I have
  15. had several people test it and they seem happy with it.  I am very interested
  16. in getting feedback from any body who chooses to use it.  
  17.  
  18. The alarm feature requires that the user have 'at' priveleges.
  19.  
  20. To install it:
  21. 1) Change the first line to reflect your perl path
  22. 2) Change any of the configuration variables located in the top section.
  23.    Please do not make any changes below the warning line.
  24. 3) To install the man page simply make a link from your man directory to this
  25.    program.  The man page is included in the program.
  26.    ie.  ln -s /usr/man/manl/xcalendar+.1 /usr/bin/X11/xcalendar+
  27.    To read the man page without actually installing it try:
  28.    troff -man xcalendar+ in the same directory as the program
  29.  
  30. To automate the alarm feature I suggest making a cron entry similar to the
  31. following, although it isn't necessary.
  32.  
  33. 0 1 * * 1,2,3,4,5 /usr/bin/X11/xcalendar+ -A -w > /dev/null 2>&1
  34. 0 8,9,19,11,12,13,14,15,16 * * 1,2,3,4,5 /usr/bin/X11/xcalendar+ -a -w >
  35. /dev/null 2>&1
  36.  
  37. email: ekatz@ncsa.uiuc.edu
  38. -----
  39. #! /bin/sh
  40. # This is a shell archive.  Remove anything before this line, then feed it
  41. # into a shell via "sh file" or similar.  To overwrite existing files,
  42. # type "sh file -c".
  43. # Contents:  README xcalendar+
  44. # Wrapped by kent@sparky on Wed Mar  3 09:54:52 1993
  45. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  46. echo If this archive is complete, you will see the following message:
  47. echo '          "shar: End of archive 1 (of 1)."'
  48. if test -f 'README' -a "${1}" != "-c" ; then 
  49.   echo shar: Will not clobber existing file \"'README'\"
  50. else
  51.   echo shar: Extracting \"'README'\" \(1143 characters\)
  52.   sed "s/^X//" >'README' <<'END_OF_FILE'
  53. XThis is a program that I wrote and have been using for about 1 year.  I have
  54. Xhad several people test it and they seem happy with it.  I am very interested
  55. Xin getting feedback from any body who chooses to use it.  
  56. X
  57. XThe alarm feature requires that the user have 'at' priveleges.
  58. X
  59. XTo install it:
  60. X1) Change the first line to reflect your perl path
  61. X2) Change any of the configuration variables located in the top section.
  62. X   Please do not make any changes below the warning line.
  63. X3) To install the man page simply make a link from your man directory to this
  64. X   program.  The man page is included in the program.
  65. X   ie.  ln -s /usr/man/manl/xcalendar+.1 /usr/bin/X11/xcalendar+
  66. X   To read the man page without actually installing it try:
  67. X   troff -man xcalendar+ in the same directory as the program
  68. X
  69. XTo automate the alarm feature I suggest making a cron entry similar to the
  70. Xfollowing, although it isn't necessary.
  71. X
  72. X0 1 * * 1,2,3,4,5 /usr/bin/X11/xcalendar+ -A -w > /dev/null 2>&1
  73. X0 8,9,19,11,12,13,14,15,16 * * 1,2,3,4,5 /usr/bin/X11/xcalendar+ -a -w >
  74. X/dev/null 2>&1
  75. X
  76. Xnroff -man xcalendar+ will produce the man page.
  77. X
  78. Xemail: ekatz@ncsa.uiuc.edu
  79. END_OF_FILE
  80.   if test 1143 -ne `wc -c <'README'`; then
  81.     echo shar: \"'README'\" unpacked with wrong size!
  82.   fi
  83.   # end of 'README'
  84. fi
  85. if test -f 'xcalendar+' -a "${1}" != "-c" ; then 
  86.   echo shar: Will not clobber existing file \"'xcalendar+'\"
  87. else
  88.   echo shar: Extracting \"'xcalendar+'\" \(17940 characters\)
  89.   sed "s/^X//" >'xcalendar+' <<'END_OF_FILE'
  90. X#!/ncsa/bin/perl
  91. X'di';
  92. X'ig00';
  93. X#
  94. X# $Header$
  95. X#
  96. X# $Log$
  97. X# xcalendar+ v1.0
  98. X# Eric Dean Katz
  99. X# ekatz@ncsa.uiuc.edu
  100. X# Last Revised: 09 February 1993
  101. X#
  102. X# The purpose of this perl program is to interface with Xcalendar v.3.0
  103. X# and provide the user with an 'alarm' to remind them of appointments 
  104. X# via email either at run time or a predetermined number of minutes
  105. X# prior to the appointment.
  106. X#
  107. X# It is best run either via cron or possibly in a .login file.
  108. X# In order to utilize the '-t, -a, or -A' options the user must have 
  109. X# cron.allow and at.allow priveleges.
  110. X#
  111. X# NOTE: The man page resides in this file.  Simply make a link from
  112. X# your man directory to this program and it can be used both as the 
  113. X# executable and the man page.
  114. X# DO NOT REMOVE ANY OF THE FORMATTING SYMBOLS THAT YOU DO NOT RECOGNIZE 
  115. X# OR THE MAN FORMATTING WILL NOT WORK!  THEY LOOK LIKE COMMENTS BUT THEY
  116. X# MEAN SOMETHING TO NROFF (TROFF) 
  117. X#==================================================================== 
  118. X#
  119. X# Configuration variables ...
  120. X#
  121. X# Where is this program installed:
  122. X$PROGRAM_PATH = "/usr/bin/X11/xcalendar+";
  123. X#
  124. X# What is the default lead time in minutes (time prior to an appointment
  125. X# that the user is notified)
  126. X$LEAD_TIME = 10;
  127. X#
  128. X# What is the default number of day to list with -l option?
  129. X$DEF_DAYS2LIST = 7;
  130. X#
  131. Xrequire 'ctime.pl';
  132. Xrequire 'getopts.pl';
  133. X
  134. Xif (-e "/vmunix") {
  135. X    $BSD = "true";
  136. X# You may need to change the following if they are not
  137. X# installed in the 'standard' place
  138. X    $mailpath = "/usr/ucb/mail";
  139. X    $atpath = "/var/spool/cron";
  140. X    }
  141. Xelse {
  142. X    $BSD = "false";
  143. X    $mailpath = "/usr/sbin/Mail";
  144. X    $atpath = "/usr/lib/cron";
  145. X}
  146. X
  147. X# DO NOT CHANGE ANYTHING BELOW THIS LINE
  148. X#==================================================================== 
  149. X
  150. X# Get the current time and format it:
  151. X$DATE=&ctime(time),"\n";
  152. Xif ($BSD eq "true") {
  153. X    ($day, $month, $date, $time, $year) = split (" ",$DATE);
  154. X}
  155. Xelse {
  156. X    ($day, $month, $date, $time, $TZ, $year) = split (" ",$DATE);
  157. X}
  158. X($current_hour,$current_minute) = split (":",$time);
  159. X
  160. X#
  161. X# Get the username for purposes of receiving mail. If the user
  162. X# is not logged on and getpwuid is used and returns an NIS entry
  163. X# (ie. with a leading '+') then strip off the '+'
  164. X#
  165. X$WHO = (getpwuid($<))[0] || getlogin || "Not a valid User!";
  166. Xif ($WHO =~ /\+.*/) {
  167. X    $WHO = substr($WHO,1);
  168. X}
  169. X
  170. X# Set defaults:
  171. X$WORKDAY = "false";
  172. X
  173. X# Does the user have 'at priveledges?
  174. Xif (-e "$atpath/at.allow") {
  175. X    $AT = "false";
  176. X    open(ATALLOW,"$atpath/at.allow")||die "Problem determining at priveledges\n";
  177. X    while (<ATALLOW>){
  178. X        if (/$WHO/) {
  179. X            $AT = "true";
  180. X        }
  181. X    }
  182. X    close ATALLOW;
  183. X}
  184. X
  185. Xelsif (-e "$atpath/at.deny") {
  186. X    $AT = "true";
  187. X    open(ATDENY,"$atpath/at.deny")||die "Problem determining at priveledges\n";
  188. X    while (<ATDENY>){
  189. X        if (/$WHO/) {
  190. X            $AT = "false";
  191. X        }
  192. X        
  193. X    }
  194. X    close ATDENY;
  195. X}
  196. X
  197. Xelse {
  198. X    $AT = "false";
  199. X}
  200. X
  201. X
  202. X
  203. X
  204. X&Getopts('Aat:wlL:r:m:xo:');
  205. X#  A  - Full alarm, will mail all memos and schedule appointment mailings.
  206. X#  a  - Will only schedule appointment mailings (will not mail memos.)
  207. X#  t: - Will reset the advance time on appointment mailings.
  208. X#  w  - To set the workday option, ie. times between 7:00 and 11:59 default
  209. X#    to AM, while times between 12:00 and 5:00 default to PM.
  210. X#  l  - To list the appointments for the default number of days from today.
  211. X#  L: - To list the appointments for a specified number of days from (or
  212. X#    before if the number is negative) the specified day.  Specified 
  213. X#    day is optional and defaults to today.
  214. X#  r  - To remove ALL files for the specified month.
  215. X#  m: - To specify a month other than the current month.
  216. X#  x  - To send all output to an xedit window.
  217. X#  o: - Output filename.
  218. X
  219. X# If the user wants time entries to default to 
  220. X# workday times (8:00AM <-> 5:00PM)
  221. Xif ($opt_w) {
  222. X    $WORKDAY = "true";
  223. X}
  224. X
  225. Xif (defined $opt_o) {
  226. X    $OUTFILE = $opt_o;    
  227. X}
  228. Xelse {
  229. X    $OUTFILE = "Appt_file";    
  230. X}
  231. X#
  232. X# Change to the ~/Calendar directory:
  233. X#
  234. Xchdir;
  235. Xchdir "Calendar";
  236. Xopen (OUTPUT,"> $OUTFILE");
  237. X
  238. X# If the user has opted for a different 'lead time':
  239. Xif (defined $opt_t) {
  240. X    if ($AT eq "true"){
  241. X        $LEAD_TIME = $opt_t;
  242. X        if ($LEAD_TIME == 0) {
  243. X            $AT = "false";
  244. X        }
  245. X    }
  246. X    else {
  247. X        print OUTPUT "Message from xcalendar+:\n** You don't have permission to schedule the mailing.\n** It will be sent immediately\n";
  248. X    }
  249. X}
  250. X#
  251. X#        If xcalendar+ were just run once a day the 
  252. X#        following routine wouldn't be necessary.  I wanted 
  253. X#        to account for those last minute changes and updates 
  254. X#        that so often occur during a normal workday so the 
  255. X#        user can run this program any time and any number
  256. X#         of times during the day without duplicating 'at' jobs.  
  257. X#        This routine will remove ANY existing at jobs for the 
  258. X#        current day. 
  259. X#
  260. Xif ($opt_a || $opt_A) {
  261. X$limit = 1;
  262. X    if ($AT eq "true"){
  263. X        open (AT,"at -l |");
  264. X        while ($job = <AT>){
  265. X            ($jobid) = split (" ",$job);
  266. X            system "at -r $jobid";
  267. X        }
  268. X    close AT;
  269. X    }
  270. X}
  271. X
  272. X#
  273. X#
  274. X# Do a find for filenames matching today's date:
  275. X#
  276. X
  277. Xif ($opt_l) {
  278. X    $limit = $DEF_DAYS2LIST;
  279. X}
  280. X
  281. Xif (defined $opt_m) {
  282. X    $month = $opt_m;
  283. X    $date = 1;
  284. X    $limit = 31; 
  285. X}
  286. X
  287. Xif (defined $opt_L){
  288. X    if ($opt_L =~ /.*\d,\d+/) {
  289. X        ($limit,$date) = split (/,/,$opt_L);
  290. X        if ($limit < 0) {
  291. X            $date = $date + $limit + 1;
  292. X            $limit = $limit * (-1);
  293. X        }
  294. X    }
  295. X    else {
  296. X        if (defined $opt_m) {
  297. X        die "These options don't make sense together.\nUsage: xcalendar+ -mMon [-L#days,start_date]\n";
  298. X        }
  299. X        $limit = $opt_L;
  300. X        if ($limit < 0) {
  301. X            $date = $date + $limit;
  302. X            $limit = $limit * (-1);
  303. X        }
  304. X    }
  305. X
  306. X    die "Usage: xcalendar+ -L #days[,start_date]\n" if ($limit eq 0);
  307. X    if ($date < 1) {
  308. X        print OUTPUT "\n** Please use -m option for information about the previous month **\n";
  309. X        $limit = $date + $limit;
  310. X        $date = 1;
  311. X    }
  312. X}
  313. Xif (!($opt_a) && !($opt_r) && !($opt_A)) {
  314. X    $TITLE = "\n\n\tAppointment Calendar for $WHO: $month";
  315. X    $ICON_TITLE = "$month ";
  316. X    if ($limit > 1) {
  317. X        $TITLE_LIMIT = $date+$limit-1;
  318. X        $TITLE = "$TITLE $date - $TITLE_LIMIT";
  319. X        $ICON_TITLE = "$ICON_TITLE $date - $TITLE_LIMIT";
  320. X    }
  321. X    else {
  322. X        $TITLE = "$TITLE $date";
  323. X        $ICON_TITLE = "$ICON_TITLE $date";
  324. X    }
  325. X    if (!($opt_x)) {
  326. X        print OUTPUT "$TITLE\n\n";    
  327. X    }
  328. X}
  329. X
  330. Xfor ($search_date=$date;$search_date < $date+$limit;$search_date++) {
  331. Xlocal (@memo);
  332. Xlocal (@apts);
  333. X#open (FIND, "find . -name xc$search_date$month$year -print |");
  334. Xopen (FIND, "find . -name xc$search_date$month* -print |");
  335. X#
  336. X#
  337. X#
  338. Xwhile ($todays_file = <FIND>) {
  339. X    chop $todays_file;
  340. X    open (appts,$todays_file);
  341. XENTRY: while (<appts>) {
  342. X#
  343. X#        Parse the entry into time and message:
  344. X#
  345. X        ($time, $message) = split(/\t|\s+/,$_,2);
  346. X#
  347. X#        If the time variable matches that of an appointment entry and
  348. X#        the user has opted to be notified then calculate the
  349. X#        time ($LEAD_TIME before $time) to mail to the
  350. X#        user.  Otherwise, assume it is just a reminder
  351. X#        and send mail at runtime.
  352. X#
  353. X        if ($time =~ /\d+:\d+a?A?p?P?m?M?\b/) {
  354. X        local ($modifier);
  355. X#
  356. X#         Account for and strip off am, pm suffixes
  357. X#
  358. X            if ($time =~ /[aApP]m?M?/) {
  359. X                if ($time =~ /[pP]m?M?/) {
  360. X                    $modifier = "pm";
  361. X                }
  362. X                else {
  363. X                $modifier = "am";
  364. X                }
  365. X            ($time) = split (/[aApP]/);
  366. X            }
  367. X
  368. X#
  369. X#        Parse out the 'time' variable:
  370. X#
  371. X        ($hour, $minute) = split (/:/,$time);
  372. X
  373. X#
  374. X#        If 'pm' was specified then convert it to 24 hour clock:
  375. X#
  376. X        if ($modifier =~ /pm/) {
  377. X            $hour = $hour + 12;
  378. X        }
  379. X
  380. X#
  381. X#        if the user chose the workday option then convert all
  382. X#        times during the afternoon to 24 hour clocks even if 
  383. X#        'pm' is not specified.  This can be overridden by 
  384. X#        specifying 'am'. (ie. 4:00am would not be converted.)
  385. X#
  386. X        if ($WORKDAY =~ /true/ && ($hour > 0 && $hour < 6) && !($modifier =~ /am/)) {
  387. X            $hour = $hour + 12;
  388. X        }
  389. X}
  390. X        else {
  391. X            push(@memo,$_);
  392. X            next ENTRY;
  393. X        } 
  394. X
  395. X#         Calculate advance time
  396. X#            If setting the advance time will move the notification
  397. X#            into the previous hour then you have to add 60 to
  398. X#            the difference and adjust the hour.
  399. X#            Ie. meeting at 12:10, advance time of 20 minutes,
  400. X#            (10 minutes - 20 minutes = -10) + 60 = 50 minutes,
  401. X#            hour - 1 = 11, thusly: notify at 11:50.
  402. X#
  403. X    if ($opt_a || $opt_A) {
  404. X        if ($AT ne "false") {
  405. X            if ($minute < $LEAD_TIME) {
  406. X                $notify_minute = ($minute - $LEAD_TIME) + 60;
  407. X                if ($hour > 0) {
  408. X                    $notify_hour = $hour - 1;
  409. X                }
  410. X                else {
  411. X                    $notify_hour = 23;
  412. X                }
  413. X            }
  414. X#
  415. X#            Otherwise, just subtract the amount of advance
  416. X#            notice from the time of the appointment.
  417. X#
  418. X            else {
  419. X                $notify_minute = ($minute - $LEAD_TIME);
  420. X                $notify_hour = $hour;
  421. X            }
  422. X#
  423. X#        Assign this new time to a variable (for readability)
  424. X#
  425. X        $when = "$notify_hour:$notify_minute";
  426. X#
  427. X#        Some entries may have a newline others won't.
  428. X#
  429. X        if ($_ =~ /.*\n/) {
  430. X            chop $_;
  431. X        }
  432. X
  433. X#
  434. X#        If the at job is scheduled to run later than now, then
  435. X#        schedule it, otherwise don't.
  436. X#
  437. X        if (($notify_hour > $current_hour) || ($notify_hour == $current_hour && ($notify_minute > $current_minute))) {
  438. X#
  439. X#             The format of these lines is critical to properly
  440. X#             schedule the 'at' job.  Remember $_ refers to the
  441. X#             complete message line.
  442. X#
  443. X             system "at $when today<<!\
  444. X
  445. X             $mailpath -s \"Appt: $time ...\" $WHO <<EOM\
  446. XDon't Forget ...\n\n\
  447. X$_\
  448. XEOM\
  449. X              !";
  450. X        }
  451. X    }
  452. X    else {
  453. X        push (@memo,$_);
  454. X    }
  455. X}
  456. Xelsif (!($opt_a) && !($opt_A) && !($opt_r)) {
  457. X    $new_line = "$hour:$minute:$message";
  458. X    push (@apts,$new_line);
  459. X}
  460. X}
  461. Xclose appts;
  462. X}
  463. Xclose FIND;
  464. Xif (($opt_A) && ($#memo > 0)) {
  465. Xsystem "mail -s \"Memos for $month $date\" $WHO <<!\
  466. X @memo\
  467. X!";
  468. X}
  469. X
  470. Xelsif (!($opt_a) && !($opt_A) && !($opt_r)) {
  471. X
  472. Xprint OUTPUT "-------------------------------------------------------------------------\n";
  473. Xprint OUTPUT "$month $search_date";
  474. X
  475. Xif ($#apts >= 0 || $#memo >= 0) {
  476. X#print "-----------------------------------------------------------------\n";
  477. X}
  478. Xelse {
  479. Xprint OUTPUT "\tNo Appointments\n";
  480. X}
  481. X
  482. Xif ($#apts >= 0) {
  483. Xprintf OUTPUT ("\t%-10s%-25s\n","Time","Description");
  484. Xprint OUTPUT "\t-----------------------------------------------------------------\n";
  485. X    sub numeric { $a <=> $b; }
  486. X    @sort_apts = sort numeric (@apts);
  487. X        foreach $i (0 .. $#sort_apts) {
  488. X            ($hour,$minute,$message) = split(/:/,$sort_apts[$i],3);
  489. X            if ($message =~ /\n/) {
  490. X            chop $message;
  491. X            }
  492. X            $qualifier = "am";
  493. X            if ($hour > 12 ) {
  494. X            $hour = $hour - 12;
  495. X            $qualifier = "pm";
  496. X            }
  497. X(@words) = split (/\s+/,$message);
  498. X$letter_count = 0;
  499. Xprintf OUTPUT ("\t%2s:%-3s%-4s",$hour,$minute,$qualifier);
  500. Xforeach $word (@words) {
  501. X    if (($letter_count + length($word)) <= 46 ){
  502. X        print OUTPUT "$word ";
  503. X        $letter_count = $letter_count + length($word);
  504. X    }
  505. X    else {
  506. X    print OUTPUT "\n\t\t  ";
  507. X    $letter_count = 0;
  508. X    print OUTPUT "$word "; 
  509. X    $letter_count = $letter_count + length($word);
  510. X    }
  511. X}
  512. Xprint OUTPUT "\n";
  513. X            }
  514. Xprint OUTPUT "\n";
  515. X}
  516. X    if ($#memo >= 0) {
  517. X    print OUTPUT "\tMemo:";
  518. X#print "\t-----------------------------------------------------------------\n";
  519. X    foreach $i (0 .. $#memo) {
  520. X        print OUTPUT "\n\t\t  ";
  521. X#    print "\n\tMemo #",($i + 1),":  ";
  522. X        if ($memo[$i] =~ /\n/) {
  523. X        chop $memo[$i];
  524. X        }
  525. X        (@words) = split (/\s+/,$memo[$i]);
  526. X        $letter_count = 0;
  527. X        foreach $word (@words) {
  528. X               if (($letter_count + length($word)) <= 46 ){
  529. X                    print OUTPUT "$word ";
  530. X                    $letter_count = $letter_count + length($word);
  531. X            }
  532. X            else {
  533. X                print OUTPUT "\n\t\t  ";
  534. X                $letter_count = 0;
  535. X                print OUTPUT "$word ";
  536. X                $letter_count = $letter_count + length($word);
  537. X            }
  538. X        }
  539. X
  540. X    }
  541. X    }
  542. Xif ($#apts >= 0 || $#memo >= 0) {
  543. X#print "\t-----------------------------------------------------------------\n";
  544. Xprint OUTPUT "\n";
  545. X}
  546. X}
  547. X}
  548. Xif (defined $opt_r) {
  549. X    $month = $opt_r;
  550. X    print  "Are you sure you want to delete all xcalendar files for $month? ";
  551. X    chop($answer = <STDIN>); 
  552. X    if ($answer =~ /[y|Y]+/) {
  553. X        opendir (DIR, ".");
  554. X        @to_remove = grep (/xc..?$month..../,readdir(DIR));
  555. X        close DIR;
  556. X        if ($#to_remove > 0) {
  557. X        print "** Found $#to_remove XCalendar Files ...\n";
  558. X        print "Do you want to compile a report file for $month first? ";
  559. X        chop($answer = <STDIN>); 
  560. X        if ($answer =~ /[y|Y]+/) {
  561. X            system "$PROGRAM_PATH -m$month -o$month.Summary > /dev/null";
  562. X        }
  563. X            if ($? == 0) {
  564. X            print "** Removing All XCalendar Files for $month ...\n";
  565. X                foreach (@to_remove) {
  566. X                system "/bin/rm $_";
  567. X                }
  568. X            }
  569. X            else {
  570. X            print "Error compiling report.  No files removed.\n";
  571. X            }
  572. X        }
  573. X        else {
  574. X        print "** No calendar files for $month were found.\n";
  575. X        }
  576. X    }
  577. X}
  578. Xclose OUTPUT;
  579. Xif ($opt_x){
  580. X    if ($BSD eq "true") {
  581. X    exec ("/usr/bin/X11/xedit -fn -Schumacher-Clean-Medium-R-Normal--10-100-75-75-C-60-ISO8859-1 -title '$TITLE' $OUTFILE &");
  582. X    }
  583. X    else {
  584. X    exec ("xwsh -hold -fn -Schumacher-Clean-Medium-R-Normal--10-100-75-75-C-60-ISO8859-1 -title '$TITLE' -icontitle '$ICON_TITLE' -e cat $OUTFILE ");
  585. X    }
  586. X}
  587. Xelse {
  588. Xsystem "cat $OUTFILE";
  589. X}
  590. X#
  591. X# THE FOLLOWING LINES ARE ESSENTIAL IN ORDER TO USE THIS FILE AS 
  592. X# THE MAN PAGE ALSO. 
  593. X#################################################################
  594. X
  595. X.00;
  596. X
  597. X'di        /"finish diversion--previous line must be blank
  598. X.nr nl 0-1    /"fake up transition to first page again
  599. X.nr % 0        /"start at page 1
  600. X';__END__
  601. X.TH XCALENDAR+ 1 "Aug 11, 1992"
  602. X.AT 3
  603. X.SH NAME
  604. XXcalendar+ \- Provides reminders from xcalendar files
  605. X.SH SYNOPSIS
  606. X.B Xcalendar+ [-A] [-a] [-t x] [-w]
  607. X
  608. X.B Xcalendar+ [-l] [-L lim,date] [-r mon]
  609. X.RS 11
  610. X[-m mon] [-x] [-o file]
  611. X.SH DESCRIPTION
  612. X.I Xcalendar+
  613. X
  614. Xxcalendar+ is intended to provide a mechanism for the user to be reminded of daily appointments, memos, etc.  In much the same way that the unix command 'calendar (1)' will send mail to the user based on information in their .calendar file xcalendar+ will look in the files generated by 'xcalendar v3.0' and will send mail to the user.  However, instead of the mail being sent to the user when the command is run, when possible it is sent a pre-determined number of minutes prior to the appointment.  This is u
  615. Xnlike 'calendar' which only sends one message containing all the appointments for the day at one time.  Used in conjuction with 'xmail' which rings the terminal bell and signifies newly received mail (or an equivalent mail package that supports 'biffing') xcalendar+ acts as an alarm to notify the user of an impending appointment.  
  616. X
  617. Xxcalendar+ only schedules mailings for the current day.  Any changes made to future dates will not require rerunning xcalendar+.  However, any changes made to the current date on the xcalendar will require that you rerun xcalendar+ in order to adjust for the changes to the day's activities (it is suggested that updates be done with the -a flag.  See below.) 
  618. X
  619. Xxcalendar+ is most useful when put in a crontab file to run
  620. Xearly in the day or when put in a user's .login file.
  621. X.TP 10
  622. X-A
  623. XFull alarm.  This will mail all memos and schedule appointment mailings according to the Calendar file.  It is suggested that this be utilized in a crontab file to run once before the workday begins.
  624. X
  625. X.TP
  626. X-a
  627. XThis will only schedule appointment mailings and will NOT mail memos.  This is best used after a change has been made to the current day's schedule.  There is no need to re-mail memos.  It is suggested also that this be utilized in a crontab file to run at regular intervals during the day (ie. every hour) if you make frequent changes to your calendar during the day.
  628. X
  629. X.TP
  630. X-t x
  631. XWill mail the user 'x' minutes before the appointment.  If the user does not wish to schedule a mailing for each appointment but rather wants one mailing at run time then this value should be set to 0 (zero).  Valid entries for scheduled mailings must be in the form 
  632. X
  633. X.RS 10
  634. XHH:MM[aApP[mM]] MESSAGE 
  635. X.LP
  636. XThe am/pm qualifier is optional but will be affected by the -w option described below.  No white space can appear between the HH:MM and the qualifier however any number of white spaces/tabs can be inserted between the time and the message.  If the first field of a line does not begin in the HH:MM format it will be assumed to be a general memo and will be mailed to the user at run time.  
  637. X
  638. X.LP
  639. XScheduled mailing entries would be:
  640. X
  641. X.RS 5
  642. X.PD 0
  643. X.LP
  644. X10:00 Meeting, 100 Office Building
  645. X.LP
  646. X10:00a Meeting - 100 Office Building
  647. X.LP
  648. X10:00PM Meeting at 100 Office Building
  649. X
  650. X.RE
  651. X.LP
  652. XMemo entries would be:
  653. X
  654. X.RS 5
  655. X.LP
  656. X100 Office Building - Meeting
  657. X.LP
  658. X1000A Office Building, Meeting
  659. X.LP
  660. X.RS 3 
  661. X(Meaning Room #1000A, NOT the time 10:00A.)
  662. X.RE
  663. X.LP
  664. X1000A Office Building, Meeting @ 10:00.
  665. X.RS 3
  666. X(Would NOT be mailed x minutes before 10:00.)
  667. X.RE
  668. X.RE
  669. X
  670. XREMEMBER:
  671. X.LP
  672. XTime entries must be the first field in each line and must contain a colon (:)  If the line does not begin in the format 'HH:MM' it is assumed to be a general memo and will not be mailed x minutes prior to the appointment, but rather at runtime.
  673. X
  674. X.RE
  675. X.PD
  676. X.TP
  677. X-w
  678. XAssumes an 8:00am to 5:00pm workday.  In other words, if the user makes a calendar entry for 3:00 with no qualifier (ie. am or pm) 3:00pm or 15:00 is assumed.  This is intended to make calendar entries less cumbersome.
  679. X
  680. X.TP
  681. X-l
  682. XTo list the appointments for the default number of days from today.
  683. X
  684. X.TP
  685. X-L [lim,[start]]
  686. XTo list the appointments for a specified number of days from the specified start date.  If start date is omitted the default is today.  If the value of lim is negative than this is taken to mean the number of days prior to start date.
  687. X
  688. X.TP
  689. X-m mon
  690. XTo specify a month other that the current.  This is to be used in conjuction with the -L option where a start date is specified.  Using the -m flag without the -L flag defaults to the entire month.
  691. X
  692. X.TP
  693. X-o file name
  694. XTo specify an output file other than the default (HOME/Calendar/Appt_file)  Unless a fully qualified path is specified all filenames will be in reference to HOME/Calendar.
  695. X
  696. X.TP
  697. X-x
  698. XTo send all output to an XEDIT window.  NOTE: Changes made in this window will NOT affect the daily xcalendar files.
  699. X
  700. X.TP
  701. X-r mon
  702. XTo remove ALL files for the specified month.  You will first be promted as to whether you want to compile a summary report for that month before removing the files.
  703. X.SH ENVIRONMENT
  704. XNo environment variables are used.
  705. X.SH FILES
  706. X~/Calendar/xcDDMMYY
  707. X.SH AUTHOR
  708. XEric Katz
  709. X.SH "SEE ALSO"
  710. XXcalendar (1)
  711. X.SH DIAGNOSTICS
  712. XWill complain if user does not have 'at' priveledges.
  713. X
  714. X.SH BUGS
  715. XNone.
  716. X
  717. X
  718. X
  719. END_OF_FILE
  720.   if test 17940 -ne `wc -c <'xcalendar+'`; then
  721.     echo shar: \"'xcalendar+'\" unpacked with wrong size!
  722.   fi
  723.   # end of 'xcalendar+'
  724. fi
  725. echo shar: End of archive 1 \(of 1\).
  726. cp /dev/null ark1isdone
  727. MISSING=""
  728. for I in 1 ; do
  729.     if test ! -f ark${I}isdone ; then
  730.     MISSING="${MISSING} ${I}"
  731.     fi
  732. done
  733. if test "${MISSING}" = "" ; then
  734.     echo You have the archive.
  735.     rm -f ark[1-9]isdone
  736. else
  737.     echo You still must unpack the following archives:
  738.     echo "        " ${MISSING}
  739. fi
  740. exit 0
  741. exit 0 # Just in case...
  742.