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
Then there's python-dateutil. However this requires: six and pysetuptools. So these will have to be installed first.
tar xvf six.tar.gz
tar xvf pysetuptools.tar.gz
tar xvf python-dateutil.tar.gz
Then python-element tree
tar xvf python-elementtree.tar.gz
Finally python-gcalcli itself.
tar xvf gcalcli-1.4.tgz
See the wonders of having fine-grained control over package management!
Now that gcalcli is installed, for automated logins, create a ~/.gcalcli
Or run it from the command line in each instance (
gcalcli --user user --pw password agenda
To view a calendar simply type
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.
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 'firstname.lastname@example.org' 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.
After that it was a case of installing pip and walking through the new required modules.
tar xvf pip.tar.gz
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.
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.