Page 1 of 11 123 ... LastLast
Results 1 to 10 of 108

Thread: Google Calendar into Conky

  1. #1
    Join Date
    Jul 2005
    Beans
    740
    Distro
    Ubuntu 12.04 Precise Pangolin

    Google Calendar into Conky

    Here is a simple tutorial on getting your Google Calendar on Conky.
    Google calendar is a very useful due to it's accessibility, while Conky is great way to display information in subtle manner.

    GCalcli is a command line tool that lets you access your Google Calendar in a terminal.
    http://code.google.com/p/gcalcli/

    Thankfully it was added to the repositories in Hardy.


    Step One GCalcli
    To install gcalcli
    Code:
    sudo apt-get install gcalcli
    Then in your home folder you need to create a config file with your Google Calendar logins. Create the file by running this command:
    Code:
    gedit ~/.gcalclirc
    Then in text file enter your Google Calendar username & password in this format. Note in the username in don't include the "@gmail.com" part.

    Code:
    [gcalcli]
    user: yourusername
    pw: yourpassword
    If you want to test it enter this command in a terminal
    Code:
    gcalcli --nc agenda
    It should list an agenda from your calendar for the next five days

    You need to create the script file below to update the file with your Google Calendar data.
    In the script you need to set 1 variable, the file path to the text file that will hold the calendar data.


    Code:
    #!/bin/bash
    gcalcli --nc agenda | tee /pathToTextFile/gcal.txt
    Edit: This post explains how to get your agenda for the next 2 months
    http://ubuntuforums.org/showpost.php...9&postcount=45

    You need to cut and past the above code into a file called gcal.sh.
    Then you can run the script in a terminal by
    Code:
    bash /pathtoFolder/gcal.sh
    Note. Gcalcli provides many other outputs including a calendar like output. You can read about it here:
    http://code.google.com/p/gcalcli/wiki/HowTo

    If you want you can get the script to run every X minutes by editing your cron. I don't want to go into this . This thread deals Cron comprehensively
    http://ubuntuforums.org/showthread.php?t=102626

    Step Two Conky
    To get the Google Calendar data in your Conky, edit your config file.
    Code:
    gedit .conkyrc
    Then find the word "TEXT" in it, below it you can add the following line
    Code:
    ${head /pathToTextFile/gcal.txt 10 20}
    Note. 10 is the number of lines from the top of text file. You also need to increase your text buffer if you planning to read many lines by editing the following lines.
    Code:
    # Maximum size of buffer for user text, i.e. below TEXT line.default is 16384 bytes
    max_user_text 32768

    That's it. I have attached a small example of how it can look like.

    This was tested on the Gcalci & Conky that came with Hardy 8.04

    You can also find my Conky & Tomboy tutorial here:
    http://ubuntuforums.org/showthread.php?t=805211
    Attached Images Attached Images
    Last edited by pt123; May 6th, 2012 at 08:03 PM. Reason: username for gmail, next 2 months

  2. #2
    Join Date
    May 2005
    Beans
    96

    Re: Google Calendar into Conky

    Sounds great, I was actually wainting for that for a while, however I have an error running the "gcalcli --nc agenda" command.

    Code:
    sweetth@ubuntu:~$ gcalcli --nc agenda
    Traceback (most recent call last):
      File "/usr/bin/gcalcli", line 1114, in <module>
        DoooooItHippieMonster()
      File "/usr/bin/gcalcli", line 1044, in DoooooItHippieMonster
        gcal.AgendaQuery()
      File "/usr/bin/gcalcli", line 777, in AgendaQuery
        eventList = self._SearchForCalEvents(start, end, start, None)
      File "/usr/bin/gcalcli", line 710, in _SearchForCalEvents
        feed = self.gcal.CalendarQuery(query)
      File "/var/lib/python-support/python2.5/gdata/calendar/service.py", line 115, in CalendarQuery
        result = self.Query(query.ToUri())
      File "/var/lib/python-support/python2.5/gdata/calendar/service.py", line 111, in Query
        result = self.Get(uri)
      File "/var/lib/python-support/python2.5/gdata/service.py", line 556, in Get
        'reason': server_response.reason, 'body': result_body}
    gdata.service.RequestError: {'status': 400, 'body': 'Invalid UserId p', 'reason': 'Bad Request'}

  3. #3
    Join Date
    Jul 2005
    Beans
    740
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Google Calendar into Conky

    Quote Originally Posted by sweetthdevil View Post
    Sounds great, I was actually wainting for that for a while, however I have an error running the "gcalcli --nc agenda" command.

    Code:
    sweetth@ubuntu:~$ gcalcli --nc agenda
    gdata.service.RequestError: {'status': 400, 'body': 'Invalid UserId p', 'reason': 'Bad Request'}

    The error is there you are placing the incorrect user id in the config file.

    When you place the username in the config file don't include the "@gmail.com" part.

  4. #4
    Join Date
    May 2005
    Beans
    96

    Re: Google Calendar into Conky

    Well actually no, the problem come from the weather calendar I was using witinh my Google calendar, I deleted it, and is now working fine.

    Many thanks, great how to!

  5. #5
    Join Date
    Jul 2005
    Beans
    740
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Google Calendar into Conky

    Quote Originally Posted by sweetthdevil View Post
    Many thanks, great how to!
    Why not use Thanks button

  6. #6
    Join Date
    May 2005
    Beans
    96

    Re: Google Calendar into Conky

    Done, funny, never knew what was the icon for...

  7. #7
    Join Date
    Jun 2007
    Location
    Kuwait
    Beans
    107
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Google Calendar into Conky

    that sounds great and i would like to try it... but how would i do it on Gusty since its not available on its repos...

    Khalaf

  8. #8
    Join Date
    Jul 2005
    Beans
    740
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Google Calendar into Conky

    Quote Originally Posted by inter-m View Post
    that sounds great and i would like to try it... but how would i do it on Gusty since its not available on its repos...

    Khalaf
    You can but it is a little meessy. When I was on hardy I had to install using the tar ball. There were problems with dependencies (if recall correctly python-xml-tree)

  9. #9
    Join Date
    May 2005
    Beans
    96

    Re: Google Calendar into Conky

    Hi me again...

    a quick question, I am looking for an option to go to the next line after a certain numbers of characters, trouble is the output of my scheddule is often too long, so i whish to cut the lenght by half, but if I use the "maximum_width" option it's just cut the text from one side.

    Do you know what I mean?

  10. #10
    Join Date
    Nov 2007
    Location
    NC, USA
    Beans
    829
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Google Calendar into Conky

    I keep getting a "failed to authenticate". Im not doing the Conky thing, I just want to access the calendar from the command line.
    Linux User #460341 || Ubuntu User #19510 || Unanswered Posts Team

Page 1 of 11 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •