Computer-based calendars are very useful, and the Google Calendar is probably one of the more widely used personal calendars other than scheduling programs such as MS Outlook and Groupwise (both of which are broken). But, webby gooey applications can be rather bothersome because they tend to take up a lot of screen real estate and other resources, and on smaller screens such as a laptop can be rendered virtually useless by all that added functionality built into the web browser itself as well as the calendar page. It is quite possible that on your laptop, your Google Calendar may look something like this:
Not very useful.
It is a little easier if you use Google Calendar’s “agenda view” which simply lists, in chronological order, the upcoming appointments, so days on which you have nothing scheduled do not take up space. Like this:
But that still kind of sucks, since the vast majority of information on that screen has little to do with the information you are looking for. As long as a command line interface is available, which it is, wouldn’t it be nice to have a quick and dirty command that you could type in to retrieve your calendar, perhaps manipulate it, and even get a simple text-based agenda view that one can actually see?
There is, and it’s called gcalcli. When I type “gcalcli” into a command line with the argument “agenda”, I get this:
With relatively little configuration, gcalcli knows where to go and get my calendar information. The program has lots of options, most of which are used to select among the various calendars you have access to or to configure the output. When I typed in:
the program outputs a list of four calendars that I have access to. I knew about the first two of them already. The third is a calendar called “US Holidays” which I imagine comes along with Google Calendar. The fourth is that of an organization I belong to, though I had forgotten about the calendar.
One option tells the “agenda” command to include all the details within the calendar and not just the date/time and name of event. The calendars can be searched (but for whole words only). Another command outputs a week’s calendar in a nice formatted arrangement:
And, yet another outputs an entire month. Unfortunately, when I tried that I got an error and some gobbly-code.
It is possible to add single appointments using the command “quick”:
There is also a way to execute a command if an event is to occur within a certain amount of time. This might be run on start up of a particular terminal or integrated with a chron job, to develop your own personal way of annoying yourself into getting your stuff done.
There are lots of other options. You can read more about it here, and if you are using Debian/Ubuntu, you can install the software in synaptic (search for gcalcli) or by simply typing the magic words:
sudo apt-get install gcalcli
This application firmly sits in the Class II cli App category, which I’ve discussed before. This is where you want a GUI version and a cli version of the same app, in this case, accessing the same database. Different circumstances demand different approaches. Learning two or three commands with gcalcli will augment your Google Calendar experience and make you look really cool at the coffee shop. But there will still be times when the web-based GUI interface makes the most sense.
Furthermore, and I’m sure you already know this, you can easily define and save an alias for “gcalcli agenda” (or any other combination of frequently used commands and options) so you would type only, say “agenda” or “appointments” or whatever to get the output you need on a regular basis.
Here’s another little trick in case you want to totally geek out. If you are using alpine for your email (I’ll discuss this great app later) you can type in ctrl-_ and call emacs as your secondary editor. From within emacs, select some irrelevant text (that step may not be necessary) and type ctrl-u to cause the output of the next command to replace that text. Then type shift-alt-| (the vertical bar thingie), which allows you to enter a shell command. Then, type in
gcalcli --nc agenda
The –nc strips the output of its color coding control codes, which are messy when they are not spewed onto a terminal. The selected text will be replaced with your agenda in nice, text form. Save, exit, and you’re back in alpine with your email to your significant other who just asked you “Are you available Wednesday night to go pick up the new car seat?” or whatever.
Obviously once you’ve done that a few times and perhaps refined the exact procedure, you’d make these commands into a macro so little more than a stern look and the flip of a single finger will insert your current agenda into whatever email you are currently writing. How cool is that?