Reminder/PIM application with compact "next 7 days" view?

Hal Burgiss hal at burgiss.net
Sun May 11 16:32:29 UTC 2008


On Sat, May 10, 2008 at 12:13:05PM -0400, Hal Burgiss wrote:
> On Sat, May 10, 2008 at 03:54:05PM +0100, Chris G wrote:
> > > 
> > But what does its "default output" contain?  That's the first hurdle
> > to overcome, can it be set up so that it shows the next few days
> > events only?
> 
> I am sure it can. I beleive the default is today only, but there are
> modes for week or month, and so on. I typically either do a week or a
> month at a time.

This is probably deeper than most want to go, but remind is really a
scriptable lanuage to manipulate date related data. Below is a short
script to make the number of days shown configurable, to make the
starting date configurable, and to massage the output a little:


#!/bin/bash

# File with remind data in it.
in_file=/usr/share/remind/hals-stuff

# These two can be overridden on command line with -s and -n respectively
start=0
num_days=10

# Parse command line, look for over-rides
for i in "$@";do
     case $i in
            -n)
                 [ -n "$2" ] && num_days=$2 && shift
                 shift
            ;;
            -s)
                 [ -n "$2" ] && start=$2 && shift
                 shift
            ;;
     esac
done

# Generate the reminders within the specified time period
remind=$(
 for i in $(seq $start $num_days);do 
     remind $in_file \
     `(echo 'banner %'; \
       echo 'msg [trigger(today()+'$i')]' ) |\
      remind - `
  done
  )

# Clean up output, make it pretty, spit it out.
echo "$remind" |grep -v "No reminders" |grep -v "^$" |sed -r 's/Reminders for /\n\*/'

# eof


This generates output like:


*Monday, 12th May, 2008:
Staff meeting, 3:00
Dentist 4:00

*Tuesday, 13th May, 2008:
PNK Meeting 7:30
Lunch w/ Jerry V.
Lilly's birthday

-- 
Hal
 




More information about the ubuntu-users mailing list