Slackware Install and Use of gcalcli

In the organisation of one's life it's a good idea to make use of a scheduler - that is, a diary, a calender, etc - as distinct from a to-do list which will be visited at another time. This is the place for appointments etc that should not be changed; not tasks or projects. One particularly popular implementation, given that it can be accessed anywhere where one has Internet access, is Google Calendar. However, like many of Google's applications it's a little bit on the fat and slow side (how a company with such a simple search engine interface ended up with such clunky applications is also for another discussion). One means to use this application in a lightweight fashion is gcalcli, an abbreviation of "Google Calendar by the Command Line Interface".

Installation of this in other distributions is relatively easy, depending on the package management system and the repositories. In Slackware however, it's slightly more tricky because Slack likes the user to take control of the prerequisites. Sometimes there can be a few of these, so with this in mind the following is offered from which any competent user should be able to convert the instructions into a script.

The requirements for gcalcli (apart from python) are gdata, python-dateutil, and python-elementtree. Install these as a privileged user. The process is the same for each item; download the Slackbuild script tarball, extract, change to the relevant directory, download the source package, run the build script, install package.

First install gdata, starting with the assumption that the user is in their favourite installation directory.

tar xvf gdata.tar.gz
cd gdata
installpkg /tmp/gdata-2.0.18-x86_64-1_SBo.tgz
cd ..

Then there's python-dateutil. However this requires: six and pysetuptools. So these will have to be installed first.

tar xvf six.tar.gz
cd six
installpkg /tmp/six-1.6.1-x86_64-1_SBo.tgz
cd ..

tar xvf pysetuptools.tar.gz
cd pysetuptools
installpkg /tmp/pysetuptools-3.4.4-x86_64-1_SBo.tgz
cd ..

tar xvf python-dateutil.tar.gz
cd python-dateutil
installpkg /tmp/python-dateutil-2.2-x86_64-1_SBo.tgz
cd ..

Then python-element tree

tar xvf python-elementtree.tar.gz
cd python-elementtree
installpkg /tmp/python-elementtree-1.2.7_20070827_preview-x86_64-1_SBo.tgz
cd ..

Finally python-gcalcli itself.

tar python-gcalcli.tar.gz
cd python-gcalcli
tar xvf gcalcli-1.4.tgz
installpkg /tmp/python-gcalcli-1.4-x86_64-1_SBo.tgz

See the wonders of having fine-grained control over package management!

Now that gcalcli is installed, for automated logins, create a ~/.gcalcli


pw: password
cals: all

Or run it from the command line in each instance (gcalcli --user user --pw password agenda

To view a calendar simply type

gcalcli agenda

The start time default is 12am today and end time default is 5 days from start. This can be modified with the general express of agenda start end e.g.,

gcalcli agenda 05/01 10/30.

To display a week based agenda in a nice calendar format use:

gcacli calw 4

The number is the number of weeks weeks is the number of weeks to display. Start time default is beginning of the current week. Another option is just to display the month.

gcalcli calm

To add items to the calendar using the quick option use the following syntax. Note that is DD/MM.

gcalcli quick "05/06 19:00 Linux Users of Victoria."

If you have multiple google accounts (e.g., organisational accounts) you may have to clear cache or specify e.g.,

gcalcli --calendar '' quick "05/02 19:00 Linux ctte meeting"

To search and display calendar entries with the keywords (case insensitive).

gcalcli search "Philosophy Forum"

There's many other options in the basic how to, but the above is ample to use it just like a calendar.

Note that the Slackware version of gcalcli is somewhat older than others, and lacks some features (like editing and deleting events).

As an update, I installed the latest version of gcalcli independent of the Slackware packages. There were, unsurprisingly, further requisite packages and python modules but it does come with new features (mentioned above) and better authentication. The following are the actions taken to install the new version.

Firstly, install the code from Github. Or just the raw file if you like (which is what I did for the initial test), moving the original to /usr/bin/gcalcli.OLD.

After that it was a case of installing pip and walking through the new required modules.

tar xvf pip.tar.gz
cd pip
installpkg /tmp/pip-1.5.4-x86_64-2_SBo.tgz
pip install python-gflags
pip install httplib2
pip install --upgrade google-api-python-client

Then in the user account, removing the username and password in plain-text.

rm ~/.gcalclirc

The newer OAuth2 is used for authenticating with your Google account. The resulting token is placed in the ~/.gcalcli_oauth file. When you first start gcalcli the authentication process will proceed.