But it means having Google Calendar open. Which, honestly, I don't often do. With alerts, I have Evolution keeping track, I have some code that checks my calendar and sends me IMs to warn me, and there's what Google does automatically with SMS and email. If I have to go, I don't need Google Calendar open to remind me. So, like with Twitter and other things I've coded, what I need is a way to use Google Calendar without really using Google Calendar.
And
gcalcli
is that. It's a snazzy command line interface to Google. For Ubuntu folks, installation is as easy as sudo apt-get install gcalcli
, and it shouldn't be much harder for the rest of you. All you need to do is type:
gcalcli quick '7pm Pick up Windows7 at Best Buy '
And there it is.
But I can't leave it there.
I've come to liking this kind of form for more social and less structured commands
program Long line of words that is a sentence, not an array of commands
So, I have a wrapper for the quick function here.
#!/usr/bin/perl
use strict ;
use warnings ;
use 5.010 ;
use subs qw{ set_status } ;
my $args = join ' ', @ARGV ;
if ( $args eq '' ) {
while () {
$args .= $_;
}
}
create_event( $args ) ;
exit ;
########## ########## ########## ########## ########## ########## ##########
sub create_event {
my ( $msg ) = @_ ;
qx{/usr/bin/gcalcli quick '$msg' } ;
say $msg ;
}
########## ########## ########## ########## ########## ########## ##########
The thing I like most about this is how I don't have to worry about handling passwords. It's in the .gcalcli config itself. More on other uses later.
That wrapper script can be reduced to 2 lines:
ReplyDelete#!/bin/bash
gcalcli quick "$@"
Not quite. But would've been nice if it had worked.
ReplyDeletejacoby@oz:~$ cat foo.sh ; ./foo.sh Mow the dang yard 5:30pm-8:30pm
#!/bin/bash
echo "$@" ;
/usr/bin/gcalcli quick "$@" ;
Mow the dang yard 5:30pm-8:30pm
Error: invalid event text
Usage:
....