Gcalcli – Google Calendar in Command Line /Desktop Widget

Google Calendar desktop widget command line

Gcalcli is a command line tool for Linux users to manage Google Calendar. It allows you to get your agenda, search for, add, delete, edit events and even import those annoying ICS/vCal invites from Microsoft Exchange and/or other sources.

Additionally, gcalcli can be used as a reminder service and execute any application you want when an event is coming up.

Gcalcli features:

  • OAuth2 authention with your Google account
  • list your calendars
  • show an agenda using a specified start/end date and time
  • ascii text graphical calendar display with variable width
  • search for past and/or future events
  • “quick add” new events to a specified calendar
  • “add” a new event to a specified calendar (interactively or automatically)
  • “delete” event(s) from a calendar(s) (interactively or automatically)
  • “edit” event(s) interactively
  • import events from ICS/vCal files to a specified calendar
  • support for URL shortening via goo.gl
  • easy integration with your favorite mail client (attachment handler)
  • run as a cron job and execute a command for reminders
  • work against specific calendars (by calendar name w/ regex)
  • flag file support for specifying option defaults
  • colored output and unicode character support
  • super fun hacking with shell scripts, cron, screen, tmux, conky, etc

Install Gcalcli in Ubuntu:

This python app is available in the default repositories of Ubuntu 14.04, Ubuntu 14.10, and Ubuntu 12.04. So we can easily install it by running below command (or via Software Center):

sudo apt-get install gcalcli

For Ubuntu 14.04 LTS, due to this bug, we need to download & install the latest parsedatetime 1.2 to get gcalcli work.

cd /tmp

wget https://launchpad.net/ubuntu/+archive/primary/+files/python-parsedatetime_1.2-1_all.deb

sudo dpkg -i python-parsedatetime_1.2-1_all.deb

How to Use Gcalcli:

Before getting started, set up your Google Account via:

nano ~/.gcalclirc

Type in below as its content:


After saving the changes by Ctrl+X, type y, and hit Enter, use the tool via below commands:

To get your agenda:

gcalcli agenda

To get a month agenda in a nice calendar format:

gcalcli calm

Quick add an event:

gcalcli quick 'text here'

For more, run:

gcalcli --help

Display Google Calendar as Desktop Widget:

With this command line tool, you can also display Google Calendar on your desktop through conky. To do so, first install the required packages:

sudo apt-get install conky ttf-dejavu ttf-dejavu-core ttf-dejavu-extra

Then download the conky script (thanks to lffl.org):

cd && wget https://dl.dropboxusercontent.com/u/209784349/lffl/.conkyrc.txt && mv .conkyrc.txt .conkyrc

Finally run conky from terminal or Alt+F2 command box and you’ll see something like below:

via: github, lffl.org