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.


wget http://slackbuilds.org/slackbuilds/14.1/libraries/gdata.tar.gz
tar xvf gdata.tar.gz
cd gdata
wget http://gdata-python-client.googlecode.com/files/gdata-2.0.18.tar.gz
./data.SlackBuild
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.


wget http://slackbuilds.org/slackbuilds/14.1/python/six.tar.gz
tar xvf six.tar.gz
cd six
wget http://pypi.python.org/packages/source/s/six/six-1.6.1.tar.gz
./six.SlackBuild
installpkg /tmp/six-1.6.1-x86_64-1_SBo.tgz
cd ..


wget http://slackbuilds.org/slackbuilds/14.1/python/pysetuptools.tar.gz
tar xvf pysetuptools.tar.gz
cd pysetuptools
wget https://pypi.python.org/packages/source/s/setuptools/setuptools-3.4.4.tar.gz
./pysetuptools.SlackBuild
installpkg /tmp/pysetuptools-3.4.4-x86_64-1_SBo.tgz
cd ..


wget http://slackbuilds.org/slackbuilds/14.1/python/python-dateutil.tar.gz
tar xvf python-dateutil.tar.gz
cd python-dateutil
wget http://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.2.tar.gz
./python-dateutil.SlackBuild
installpkg /tmp/python-dateutil-2.2-x86_64-1_SBo.tgz
cd ..

Then python-element tree


wget http://slackbuilds.org/slackbuilds/14.1/python/python-elementtree.tar.gz
tar xvf python-elementtree.tar.gz
cd python-elementtree
wget http://effbot.org/media/downloads/elementtree-1.2.7-20070827-preview.zip
./python-elementtree.SlackBuild
installpkg /tmp/python-elementtree-1.2.7_20070827_preview-x86_64-1_SBo.tgz
cd ..

Finally python-gcalcli itself.


wget http://slackbuilds.org/slackbuilds/14.1/python/python-gcalcli.tar.gz
tar python-gcalcli.tar.gz
cd python-gcalcli
wget https://gcalcli.googlecode.com/files/gcalcli-1.4.tgz
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

e.g.,

[gcalcli]
user: username@gmail.com
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 'username@gmail.com' 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.


wget http://slackbuilds.org/slackbuilds/14.1/python/pip.tar.gz
tar xvf pip.tar.gz
cd pip
wget https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz
./pip.SlackBuild
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.