First, install conky:
"sudo apt-get install conky"
or
"su -c 'yum install conky'"
Next, install gcalcli:
"sudo apt-get install gcalcli"
or
"su -c 'yum install gcalcli'"
Various Configuration Files
Create a file named .conkyrc in your home directory. I use the following config:
# conky configuration # edited by kaivalagi #edited some by Jak_o_Shadows # set to yes if you want Conky to be forked in the background background no # Use Xft? use_xft yes # Xft font when Xft is enabled xftfont Bitstream Vera Sans Mono:size=9 # Text alpha when using Xft xftalpha 0.8 # Update interval in seconds update_interval 5.0 # This is the number of times Conky will update before quitting. # Set to zero to run forever. total_run_times 0 # Use double buffering (reduces flicker, may not work for everyone) double_buffer yes # Minimum size of text area minimum_size 350 5 #maximum_width 350 # Draw shades? draw_shades yes # Draw outlines? draw_outline no # Draw borders around text draw_borders no draw_graph_borders yes # Stippled borders? stippled_borders 0 # border margins #border_margin 0 # border width border_width 0 # Default colors and also border colors default_color white default_shade_color black default_outline_color white # own window options own_window yes own_window_transparent yes own_window_type desktop own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager # Text alignment, other possible values are commented #alignment top_left #alignment top_right #alignment bottom_left alignment top_left # Gap between borders of screen and text # same thing as passing -x at command line gap_x 10 gap_y 25 # Subtract file system buffers from used memory? no_buffers yes # set to yes if you want all text to be in uppercase uppercase no # number of cpu samples to average # set to 1 to disable averaging cpu_avg_samples 2 # number of net samples to average # set to 1 to disable averaging net_avg_samples 2 # Force UTF8? note that UTF8 support required XFT override_utf8_locale no # Add spaces to keep things from moving about? This only affects certain objects. use_spacer right text_buffer_size 2048 # colours color1 white # light blue color2 6892C6 # orange color3 E77320 # green color4 78BF39 # red color5 CC0000 # variable is given either in format $variable or in ${variable}. Latter # allows characters right after the variable and must be used in network # stuff because of an argument # stuff after 'TEXT' will be formatted on screen TEXT ${color1}${font Bitstream Vera Sans Mono:size=21} ${execpi 600 gcalcli --24hr calw 2 | python ~/conky/translate.py} ${font}
[gcalcli] user: user.name@gmail.com pw: password cals: owner
For Cinnamon/ATI users
Unfortunatley, the --nc option for gcalcli appears not to be working. This results in messed up formatting in conky. The solution is to strip this out using a small python script, with a regex. I put this script in ~/conky/translate.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import re def main(): detector = re.compile('\[\d+(?:;\d+)?m') for line in sys.stdin.xreadlines(): sys.stdout.write(detector.sub('',line)) if __name__ == '__main__': main()