|
HowTo
How to use gcalcli...
Login InformationYou can provide gcalcli with your Google Calendar login information either by editing the top of the script itself, using the --user and --pw arguments, or using the config file. In any case make sure you protect the information. HTTP Proxy Supportgcalcli will automatically work with an HTTP Proxy simply by setting up some environment variables: http_proxy https_proxy proxy-username proxy-password Note that these environment variables must be lowercase and beware the usage of the dashes vs underscores. Config Filegcalcli is able to read default configuration information from a config file. This file is location at '~/.gcalclirc' and must be formatted as follows: [gcalcli] <config-item>: <value> <config-item>: <value> ... The available config items are the same as those that can be specified on the command line. Note that any value specified on the command line overrides the config file. user: <username> pw: <password> cals: <type> details: <true|false> ignore-started: <true|false> width: <width> cal-owner-color: <color> cal-editor-color: <color> cal-contributor-color: <color> cal-read-color: <color> cal-freebusy-color: <color> date-color: <color> border-color: <color> 'gcalcli' event popup reminders using cronRun gcalcli using cron and generate xmessage-like popups for reminders.% crontab -eThen add the following line:*/10 * * * * gcalcli remind 'gcalcli' agenda on your root desktopPut your agenda on your desktop using Conky. Add the following to your .conkyrc: 'gcalcli' agenda integration with 'screen'Put your next event in your 'screen' hardstatus line. First add a cron job that will dump you agenda to a text file:% crontab -eThen add the following line:*/5 * * * * gcalcli --nc --ignore-started agenda "`date`" > /tmp/gcalcli_agenda.txtNext create a simple shell script that will extract the first agenda line. Let's call this script 'screen_agenda':#!/bin/bash head -2 /tmp/gcalcli_agenda.txt | tail -1Next configure screen's hardstatus line to gather data from a backtick command. Of course your hardstatus line is most likely very different than this (Mine is!):backtick 1 60 60 screen_agenda hardstatus "[ %1` ]" 'gcalcli' UsageUsage:
gcalcli [options] command [command args]
Options:
--help this usage text
--config <file> config file to read (default is '~/.gcalclirc')
--user <username> google username
--pw <password> password
--cals=[all, 'calendars' to work with (default is all calendars)
default, - default (your default main calendar)
owner, - owner (your owned calendars)
editor, - editor (editable calendar)
contributor, - contributor (non-owner but able to edit)
read, - read (read only calendars)
freebusy] - freebusy (only free/busy info visible)
--cal=<name> 'calendar' to work with (default is all calendars)
- you can specify a calendar by name or by using a
regular expression to match multiple calendars
- you can use multiple '--cal' arguments on the
command line
--details show all event details (i.e. length, location,
reminders, contents)
--ignore-started ignore old or already started events
- when used with the 'agenda' command, ignore events
that have already started and are in-progress with
respect to the specified [start] time
- when used with the 'search' command, ignore events
that have already occurred and only show future
events
--width the number of characters to use for each column in
the 'cal' command output (default is 10)
--nc don't use colors
--cal-owner-color specify the colors used for the calendars and dates
--cal-editor-color each of these argument requires a <color> argument
--cal-contributor-color which must be one of [ default, black, brightblack,
--cal-read-color red, brightred, green, brightgreen, yellow,
--cal-freebusy-color brightyellow, blue, brightblue, magenta,
--date-color brightmagenta, cyan, brightcyan, white,
--border-color brightwhite ]
Commands:
list list all calendars
search <text> search for events
- only matches whole words
agenda [start] [end] get an agenda for a time period
- start time default is 12am today
- end time default is 5 days from start
- example time strings:
'9/24/2007'
'Sep 24 2007 3:30pm'
'2007-09-24T15:30'
'2007-09-24T15:30-8:00'
'20070924T15'
'8am'
calw <weeks> [start] get a week based agenda in a nice calendar format
- weeks is the number of weeks to display
- start time default is beginning of this week
- note that all events for the week(s) are displayed
calm [start] get a month agenda in a nice calendar format
- start time default is the beginning of this month
- note that all events for the month are displayed
and only one month will be displayed
quick <text> quick add an event to default calendar
- example:
'Dinner with Eric 7pm tomorrow'
'5pm 10/31 Trick or Treat'
remind <mins> <command> execute command if event occurs within <mins>
minutes time ('%s' in <command> is replaced with
event start time and title text)
- <minutes> default is 10
- default command:
'gxmessage -display :0 -center \
-title "Ding, Ding, Ding!" %s'
|
Sign in to add a comment
On Mac OS X, I also had to install the "elementtree" python module I used 1.2.6 (http://effbot.org/media/downloads/elementtree-1.2.6-20050316.tar.gz)
I want to use this program but pleas explain with details how to install it and make it work, im a noob at command prompt!
How can I get this to work with geektools?
Download the python modules required, extract them and then run the following command for each module: python setup.py install
It appears that gcalcli doesn't work through a proxy. I set HTTP_PROXY, http_proxy , and get a failed to authenticate error
I don't know why the proxy stuff doesn't work for you. I've tested http proxy against my corporate firewall/proxyserver and against 'tinyproxy' running on a server I have on the net. Setting the appropriate environment variables worked.
Note that the http proxy stuff is within the python gdata library. If you continue to have problems you should contact the developers at: http://code.google.com/p/gdata-python-client/
It would be nice if the user could select the first week day. I'm Italian, and like most european countries we start counting weekdays from Monday.
I keep getting the following error:
Error: Failed to authenticate with Google Calendar!
I've entered my Google username and password in the .gcalclirc file. Is there any way to see a more verbose error message?
I can get gcalcli to work in a terminal, but when I copy and paste the command above to my conkyrc file it doesn't work.
I can not seem to get gcalcli working. gcalcli --user nianderson --pw password list Traceback (most recent call last):
AttributeError?: 'CalendarService?' object has no attribute 'GetAllCalendarsFeed?'nm i had an old version of gdata python module. updating does the trick
is there any chance this app can be precompiled to a .exe file and just run it using command line switches? I really dont want to download what seems like 3-4 different things and try to figure out how to set it all up.
Feature request: how do I add event to a non default calendar?
Even examples to use in screen! I love you, this fits my workflow so well!
When using the "quick" option I can only add dates today. The time is interpreted correctly, but the date ist just added to the date description. Example:
will produce a date TODAY like: Sun Dec 02 8:00pm 12/04/2007 HSK
why is that? How can I get that right? Cheers, Paddy
PatrickBlume?, try using "HSK 12/4 at 8 pm"
Thank you for this magnificent program.
I get a
As well. I've configured my .gcalclirc. Any suggestions?
Hmm. Some digging revealed I was getting a `CaptchaRequired?' exception. Going to https://www.google.com/accounts/DisplayUnlockCaptcha and submitting that form fixed it.
I get this error message (with any command basically):
$ gcalcli calm Traceback (most recent call last): File "/home/wojas/bin/gcalcli", line 1114, in ? DoooooItHippieMonster() File "/home/wojas/bin/gcalcli", line 1025, in DoooooItHippieMonster borderColor=borderColor) File "/home/wojas/bin/gcalcli", line 303, in __init__ self.allCals = self.gcal.GetAllCalendarsFeed() File "build/bdist.linux-i686/egg/gdata/calendar/service.py", line 77, in GetAllCalendarsFeed File "build/bdist.linux-i686/egg/gdata/service.py", line 512, in Get File "build/bdist.linux-i686/egg/gdata/service.py", line 493, in Get File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 381, in GDataFeedFromString File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 94, in CreateClassFromXMLString UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 9475: ordinal not in range(128)Storing my password in clear text in the config scares me - isn't there a way to use a (md5/sha1/younameit) hash?
2 ross.campbell : try set evn.variable https_proxy, like this: export https_proxy="http://192.168.0.1:8081"
And question: how to set quick reminder for other days, not only for today?
I had almost same probelm with kwojas. I changed my calendar name to blah and it start to work. Old name include letter "รค" so I quess it's some sort of character encoding problem.
What are people doing to secure their password using gcalcli on the Internet? Is it sent in the clear? Also, how do you secure it in the rc file on your computer?
As far as encrypting a password goes: there's no way to decrypt it that won't be trivially decryptable, unless you want to provide a password every time you log in - in which case, why bother storing the password at all.
If the machine you're on is reasonably secure, 600 permissions should be fine.
You can't use md5/sha1/younameit to store your password because those are one way algorithms. There would be no way to get your original password from that text. I store it the config file and ensure the permissions are 600. This is common as many other programs do the same thing (i.e. mutt, msmtp, get/fetchmail come to mind). I've heard a request to add support for gnome-keyring... quick answer, no way.
is this caching the data somewhere in something like .ics? it would be nice to be able to specify how often to actually go fetch the data from google's servers, rather than doing it every time (especially on a laptop when I'm working offline!)
also being able to fetch from google and dump to ics would be useful for things like syncing with a phone, although I see there's a separate project for doing that (http://www.gcalsync.com/)
How can I get rid of all the control characters showing up in the output? (Visa user)
They make the output completely unusable.
Example: ESC?[0m;37m+------------+--------------+ That's what the first line of a "calm" calendar looks like both in the console, and in a textfile opened in Notepad++. I tried swapping between different n*x formats, mac format, windows, etc, different encodings for viewing the file itself, but it had no impact.
Edit to the above: Vista user
I also have the "UnicodeDecodeError??" as some people above had. Unfortunately, I don't even have an umlaut in my calendar's name, only a space. I've changed that, created a brand new calendar to test and still the same unicode error. I have also applied the patch in the issues database, but to no avail.
Any hints? Running gcalcli with python 2.5 on OSX.
@ Jaron.hendrix: Add the switch "--nc" which is for "no colors". The ESC?[3 is for terminal color codes.
Darryl
cool
I had trouble to get the quick add function to work, when I found that google only makes this available if you change the language on the calendar to English. Otherwise it only interpretes the time and adds it within the next 24h.
I keep running into the error:
Error: failed to parse start time
Any help?
To fix problem with Unicode comment these lines (66 and 67)
sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout)
sys.stdin = codecs.getreader(locale.getpreferredencoding())(sys.stdin)
I like it, though I'm not fond of storing a password in the clear. Since I'm just using this for reading I made a separate gmail account, shared my calendars with it as read only, and use that gmail account for gcalcli. Not ideal, but not bad either.
Hello,
I'm trying your program and I have a problem with --details when the program tries to print all my calendars including details. If I have access to a freebusy calendar the program fails with the following message:
"
IndexError??: list index out of range "
I believe it is because the event has details but not where details. If I put the following code in line 628:
does, but in this way I'm missing when details. Of course you can check whether there are even.where before checking if you have event.where0?.details and so on....
where is the script file stored ? I do not have an @gmail.com account but an @googlemail.com account so I have to edit the script - but I cant find it !!!!!!!!!!!! please help its driving me metal ...
Found the script in usr/bin/... with all the other scripts - so that is where they have all been hiding - but still unable to get working .. I have given up now good luck - Jonathan
Thank you for this wonderful program. One quick question: Is it possible for the output of the events to show up in Conky or in Terminal using the 24 hour clock format? If so, what is the code to produce that output?
Thanks again!
YO
if i dont have a gmail, what is my username then? my email?
when there will be available to insert a complete event (not just a quick one)? i miss a lot to input all the info in the calendar
i like it very very much!!
BUT: i can't figure out how to let recognize time and date to the program... if i quick "3/4 7pm sport" it puts on tomorrow at the present date... i've tried all... no matter what... still the same... i simply can't figure out... any idea? (i'm on ubuntu jaunty with openbox)
Regarding the discrepancy of times in gcalcli and the google web interface:
Be sure to have an environment variable TZ that reflects your current timezone, eg:
export TZ="Europe/Copenhagen"
For those suffering authentication issues when using .gcalclirc, make sure there is a new line marker at the end of each configuration item e.g.
where <nl> is the new line character on your system (typically pressing enter when using your favourite editor...)
If the config file ends at the end of the pw: config line, it appears gcalcli doesn't cope with it.
working well. Would like to show events for the current day only ( agenda Today ) only, how can i do this? Thanks
jonroome - try the following:
For those who had errors which ends like: UnicodeDecodeError?: 'ascii' codec can't decode byte 0xc3 in position 132: ordinal not in range(128)
Comment out these lines (66-67): # for unicode support sys.stdout = codecs.getwriter(locale.getpreferredencoding())(sys.stdout) sys.stdin = codecs.getreader(locale.getpreferredencoding())(sys.stdin)
...and it works!
Is it possible to have the graphical output produced by calw accept a dayrange? The standard 5 days are way too wide for my conky config. Would prefer only 2/3 days.
Wonderful Program. Thanks. Is there any way to edit or delete an event.
@ roni.laukkarinen - Thanks for the tip! @ insanum - Thanks for the script!
Is there a way to get a template or model for the rc config file? I installed gcalcli via aptitude in debian lenny, and the config file is empty. I don't have an example for the syntax to create one.
Wait... Okay, I found the info re the rc above, but now get errors: Traceback (most recent call last):
ConfigParser?.ParsingError?: File contains parsing errors: /home/tony/.gcalclircNice program! But i have this warning: /var/lib/python-support/python2.6/gdata/tlslite/utils/cryptomath.py:9: DeprecationWarning?: the sha module is deprecated; usethe hashlib module instead
any suggestion?