Agendas, Google, and Zenity

technology.pngI really, really like Zenity. This guide - while a definite go-to resource - only hints at the power therein.

For example, there's the GoogleCL interface. Once set up, you have a way to automatically get your agenda for the day. But I don't want that to show up every time I open a terminal window... but I need it in my face. Enter two quick scripts. (WATCH FOR LINE WRAP)

This one gives you the agenda for any day you select on a graphically displayed calendar (defaults to the current day):

alias agenda2='bob=$(zenity --calendar --text "Pick a day" --title "Google Agenda" --date-format=%Y-%m-%d); agenda=$(google calendar list --date "$bob");zenity --info --title "Agenda" --text "Events for that day:\n$agenda"'

It gets the date from the zenity calendar dialog and returns an info box with that day's events. If you're slick, you could put in a quick test for nothing being returned, but hey.

Here's one that's appropriate for being called upon login:

alias agenda='bob=`date +%Y-%m-%d`;daytwo=`date --date="-2 days ago" +%Y-%m-%d`; agenda=$(google calendar list --date "$bob","$daytwo");zenity --info --title "Your Life" --text "$agenda"'

This gives you two day's worth of agenda items from your default calendar (that's what the "daytwo" bit is). Play with them and see what you can come up with!