wiki.allensmith.net

Personal "Rough Notes & Useful Links

User Tools

Site Tools


kb:linux:conky_gcalcli

Conky Google Calendar

Part 1 » Conky as a System Monitor
Part 2 » Conky Google Calendar using Gcalcli
Part 3 » Additional References for Conky
This is an extreamly peliminary version for the total re-write of these summary notes! These instructions need to be gone through once more (using a different PC) – to ensure that they are correct, and to provide some example output.


If Needed: Uninstall Previous Version of Gcalcli

DO NOT try the following to install gcalcli – as that version uses an old depreciated API that was finally discontinued!
sudo apt-get install gcalcli

“Google deprecated the old APIs that 2.x relies on a couple years back and EOL'd them effective yesterday. You'll need to upgrade to the 3.x release tree to get it working again.” https://github.com/insanum/gcalcli/issues/153

  • If you have the previous version of gcalcli already installed on your system, do the following to uninstall that:
    sudo apt-get purge gcalcli
    rm ~/.gcalclirc     # the old .config file NOT compatible with new program version


Install & Configure Gcalcli for Conky

  • First, install the needed packages via apt-get:
    sudo apt-get install git python-pip python-gdata python-dateutil python-gflags python-vobject python-parsedatetime python-googleapi
  • Next, use pip to install the gcalcli python application
    git clone https://github.com/insanum/gcalcli.git
    cd gcalcli
    sudo python setup.py install
    pip install vobject parsedatetime
On Ubuntu 14.04 this will result in a broken gcalcli command: (must update python-parsedatetime to fix)
  • The following additional commands provide the work-around for this:
    wget https://launchpad.net/~cjohnston/+archive/ubuntu/ppa/+files/python-parsedatetime_1.2-1~ubuntu14.04.1~ppa1_all.deb
    sudo gdebi python-parsedatetime_1.2-1~ubuntu14.04.1~ppa1_all.deb     # requires having installed gdebi

Reference: http://askubuntu.com/questions/468907/how-to-set-up-gcalcli

  • Finally, create the necessary ~/.gcalcli_oauth file, so gcalcli can assess the desired Google Account Calendar(s)
    • Start by entering the following command into the Terminal
      gcalcli list --noauth_local_webserver

      which will output a message that starts with

      WARNING:root:This function, oauth2client.tools.run(), and the use of the gflags library are deprecated
      and will be removed in a future version of the library.
      Go to the following link in your browser:
    • Next into your web-browser, copy & past the in-terminal (on-screen) url that begins with:
          https://accounts.google.com/o/oauth2/auth?
    • Then copy the result code provided by Google, and past that back into the Terminal. (then hit the Enter key)
    • And finally make the file where the oauth info is stored readable only by this user:
      chmod 700 ~/.gcalcli_oauth    # set permissions so only this user can access this file.
  • Now ensure that all the needed files for Conky itself are are installed
    sudo apt-get install conky-all ttf-dejavu ttf-dejavu-core ttf-dejavu-extra

Reference: https://github.com/insanum/gcalcli


Configure Conky to Display Google Calendar

nano ~/.conky/conkyrc_gcalcli    # copy & past the following text into this empty file
~/.conky/conkyrc_gcalcli
alignment top_left
background no
border_width 0
cpu_avg_samples 2
default_color white
default_shade_color black
default_outline_color white
own_window_colour black
color0 white
color1 #333399
color2 white
color3 #333333
draw_borders no
draw_graph_borders yes
draw_outline no
draw_shades no
use_xft yes
xftfont DejaVu Sans Mono:size=8
gap_x 5
gap_y 25
minimum_size 600 5
maximum_width 800
net_avg_samples 2
double_buffer yes
out_to_console no
out_to_stderr no
extra_newline no
 
#############################
# - Window specifications - #
#############################
own_window_class Conky
own_window yes
own_window_type normal
own_window_transparent no
own_window_argb_visual yes
own_window_argb_value 96
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
 
stippled_borders 0
update_interval 1.0
uppercase no
use_spacer none
show_graph_scale no
show_graph_range no
text_buffer_size 8096
 
TEXT
# uncomment the below line for a 2 week Calendar
#${execpi 300 gcalcli --conky --nolineart --color_border black --color_date white --color_now_marker red --calendar "Holidays"#white  --color_owner green  --width 13 calw 2}
# uncomment the below line for a 2 day Agenda
#${execpi 300 gcalcli --conky --nolineart --color_date white --calendar "Holidays"#white --color_owner green --detail_description agenda today tomorrow}
nano ~/.conky/conkystart.sh    # uncomment the line to run the Google Calendar Conky

At the bottom of the conkystart.sh startup script, uncomment the last line (remove the leading #), so the Google Calendar Conky will run when the user logs in.

kb/linux/conky_gcalcli.txt · Last modified: 2016/01/13 20:35 (external edit)