[Remind-Fans] ARM Port?

yard-ape at telus.net yard-ape at telus.net
Sat Sep 18 20:03:28 EDT 2004


David J Patrick wrote:

>On Tue, 2004-09-14 at 23:00, yard-ape at telus.net wrote:
>
>  
>
>>The next step is the GUI.  This isn't a huge priority for me; I pipe
>>remind through awk to produce plain-text timetables.  
>>    
>>
>
>coooL ! can you give a few clues as to exactly how you do that ?
>I'm trying to create a daily "callsheet" printout, combining palm-based
>date and todo entries, with weather forcasts, sun rise-set times, and
>maybe even a daily comic. I'll bet you would know how I might AWK my
>todo list to sort by various criteria (category, alarm date etc) before
>the daily printout. 
>
>thanks !
>djp
>  
>
Your own method depends on how your todo list records (or any of
your records, for that matter) are formated out of the palm program(s).
If you can get them into some form of structured plain text (like a
comma-separated-variables spreadsheet) in which each record has it's
criterion identifier, then it should be easy.

my various include files (todo list, holidays, fact for the day,
reminders, appointments, etc.) are piped through sed to format them
as I described above---with a category identifier at the beginning
of each line; something like this:

The factoid file:

18 Sep  msg * Frodo and company rescued by Bombadil (LOTR)
18 Sep  msg * Greta Garbo born, 1905
msg * Today's sunset is at [sunset()]

... Piped through "sed 's/\<msg\>/& FACTOID/'":

18 Sep  msg FACTOID  *  Frodo and company rescued by Bombadil 
(LOTR)                             
18 Sep  msg FACTOID  *  Greta Garbo born, 1905                             
msg FACTOID  * Today's sunset is at [sunset()]

The ~/.calendar file:

sat msg Fold away socks
20 Sept 2004 msg 06:00-06:15 Study 25th Psalm
sat msg 10:00-19:30 Write PHIL454 essay
20 Sep 2004 +3 msg Respond to djp on remind mail list

... After "sed 's/\<msg\>/& REMINDER/'":

sat msg REMINDER Fold away socks
sat msg REMINDER 10:00-19:30 Write a pedantic Heidegar essay
20 Sep 2004 +3 REMINDER msg Respond to djp on remind mail list


Remind passes the formatted files (all "ICLUDEd" in ~/.calendar.bin) to
awk, which sorts records by index, shaving off the index itself on
the way:

    #!/bin/bash

    awk '

        # Pick out the factoids
        $0 ~ /^[     ]*FACTOID/{
            gsub( /FACTOID /, "", $0 )
            factoid[x++] = $0
            next
        }

        # Pick out the plain reminders
        $0 ~ /^[     ]*REMINDER/{
            gsub( /REMINDER /, "", $0 )
            reminder[x++] = $0
            next
        }

        END {

        print " -- FACTS FOR THE DAY --"
        print ""

            for (item in factoid)
            printf("    %-78s\n", " * " factoid[item])

        print " -- REMINDERS --"
        print ""


            for (item in reminder)
            printf("    %-78s\n", " * " reminder[item])

        }
    '

That's about all there is to it.  The timetable function is a nested
loop through time index and records arrays, with a conditional to
test for printing.

Output of the whole script looks something like this (truncated):


 Reminders for Saturday, 18th September, 2004 
(today):                       


 -- FACTS FOR THE DAY --

         *  Frodo and company rescued by Bombadil 
(LOTR)                             
         *  Greta Garbo born, 
1905                                                   

 -- SCHEDULED EVENTS --

        -- 0500 
--                                                                   


        -- 0600 
--                                                                   

        06:00-06:15 Study 25th Psalm

        -- 0700 
--                                                                   


        -- 0800 
--                                                                   


        -- 0900 
--                                                                   


        -- 1000 
--                                                                   

        10:00-19:30 Write PHIL454 essay

...


        -- 1800 
--                                                                   

        10:00-19:30 Write PHIL454 essay

        -- 1900 
--                                                                   

        -- 2000 
--                                                                   


 -- REMINDERS --

        * Fold away socks
        * Respond to djp on remind mail list


 -- TOP PRIORITY TASKS --

         (01) Really important thing
         (02) Another Really important thing
         (03) Pretty important thing


Hope that helps.

-Derek.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.roaringpenguin.com/pipermail/remind-fans/attachments/20040918/7154c09e/attachment.htm>


More information about the Remind-fans mailing list