[Remind-Fans] Simplicity

Dave davo812 at gmail.com
Thu Mar 8 20:21:09 EST 2012


Since people are sharing some of their shortcuts, I'll make a 
contribution too.

This is the current shell function I'm using to display a monthly 
calendar.  Normally, the shell and the terminal don't always agree on 
the size of the window, especially if it's been recently resized.  So, I 
wanted something that would dynamically draw a calendar to fill the 
screen, regardless of the current screen size.

This works best using windows that are approximately square.  
Rectangular windows with one dimension much longer than the other will 
render less readable results, which is naturally expected.

LPW is lines per week and subtracting 5 could be adjusted slightly to 
taste.  My $DOTREMINDERS file is located outside the home directory and 
thus set for use with rem and other referencing.

function rcal ()
{
     MONTHS=$1;
     clear;
     eval `resize`;
     COLS=`resize|head -1|sed -e 's/^C.*=//' -e 's/;//'`;
     LINS=`resize|grep ^L|sed -e 's/^L.*=//' -e 's/;//'`;
     LPW=` expr \( $LINS / 5 \) - 5 `;
     remind -c$MONTHS -w$COLS,$LPW,1 $DOTREMINDERS | tr -d "\f"
}

-Dave

On 3/8/2012 3:41 PM, Ted Rolle, Jr. wrote:
> Yup.  In the distributed package, rem is a symlink to remind.
> I checked before doing this.
> For me, it makes remind easier to use.
>
> On 03/07/2012 03:21 PM, Dougie Lawson wrote:
>> So you've replaced the /usr/local/bin/rem program that was installed
>> as part of the product.
> _______________________________________________
> Remind-fans mailing list
> Remind-fans at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/cgi-bin/mailman/listinfo/remind-fans
> Remind is at http://www.roaringpenguin.com/products/remind


More information about the Remind-fans mailing list