:date: 2012-02-09 10:03
.. role:: strike
.. index:: linux, tech
.. _`2012-goobook`:
Goobook
=======
A love-hate relationship. That's what I have with this tool. I wasn't able to set it up on `Ubuntu 10.04 TLS `_, probably to due to the version of :strike:`fucking` `python `_, but it worked like a charm on `Ubuntu 11.04 `_. But it's that useful, that I regularly miss it on the 10.04 system and I'm getting a `creepy smile `_ all over my face when I can make use of it on another machine.
What it does? That's simple: It puts your Gmail address-book on the command-line. That's what it does. When you use mutt (:ref:`2011-mutt_imap_and_elinks`) for writing e-mails or you just need an e-mail-address from your address-book a simple
.. code:: bash
$ goobook query
will do the trick. Integrated with mutt (:ref:`2011-mutt_imap_and_elinks`) you get auto-completion (when pressing **) from the address-book (explained below).
But time to get started.
Installation
------------
In order to install `goobook `_ and (hopefully) get it up and running `download the source version 1.3 `_. There are newer alpha releases, but they didn't work so well for me and ran into some trouble from time to time. Version 1.3 does its job.
Unpack it and run the installation:
.. code:: bash
$ tar -xzvf goobook-*.tar.gz
$ cd goobook-*
$ sudo python ./setup.py install
That's it.
Configuration
-------------
Goobook checks your `~.netrc` file for the credentials.
.. code:: bash
machine google.com
login your@google.email
password secret
If you don't like that you're free to put it into `~/.goobookrc`. As you like.
When you're dealing with `~/.goobookrc` anyway, have a look in the additional configuration parameters. You can create a configuration template and modify it accordingly.
.. code:: bash
$ goobook config-template > ~/.goobookrc`
It will look like this:
.. code::
[DEFAULT]
# If not given here, email and password is taken from .netrc using
# machine google.com
;email: user@gmail.com
;password: top secret
# The following are optional, defaults are shown
;cache_filename: ~/.goobook_cache
;cache_expiry_hours: 24
The installation guide provides you with information about PGP integration for storing the login credentials secure as well.
In order to get goobook into mutt on the **-key, you modify your `.muttrc`:
To query the address book (normally bound to "Q" key):
.. code:: bash
set query_command="goobook query '%s'"`
If you want to be able to use ** to complete email addresses instead of add this:
.. code::
bind editor complete-query
You can add contacts to the address book via goobook as well, but I don't use that feature, since I'm managing my contacts at a different point. Having read access is enough for me here. The installation guide will provide you with additional information if you need them.
Problems
--------
There weren't many. And if, so I could solve them that easily with the provided documentation, that I can't remember them. Beside the initially mentioned :strike:`fucking` python problems, I only stumble into minor ones.
**Caching**
If you change your contact details somewhere else, update the Gmail entries and then expect *goobook* to come up with the right details while using the cache-function, you might end up with a surprise. The caching actually works. It means actually that *goobook* will not ask Gmail every time it wants to have an address, but will store all information locally and just occasionally update that information. All at once. That means when you add a contact it will be not cached by goobook immediately, new addresses don't show up right away. Well, you probably configured caching yourself, so stop complaining.
What you can do about it, is to empty the cache and ask goobook to reload the cache.
.. code:: bash
$ goobook reload
That will cause goobook to query new data from your address-book and that includes all changes you've recently done.
Links
-----
* `Source `_
* `Goobook issues `_