Gooey Google Contact Goodness (with mutt)
After just being acquainted with mutt (My fear of mutt, and why it was all for NULL) I forgot that I hate remembering things. I have too many things to remember already by using linux; why would I want to start having to remembering people’s names and email addresses on top of all that unix/linux sysadmin knowledge?
Well instead of hacking together some halfassed solution by exporting a csv of my google contacts, and parsing, and gobblygook; I did a quick search and found that there’s a program called goobook (Homepage) Also, and a little down the page is a neato description on how to use it with mutt.
After installing goobook (yaourt -S goobook-git) I configured it by making a new file ~/.netrc
machine google.com login me@gmail.com password my_password_here
I then tested it out to make sure it’s working:
# Enjoy all your contacts being dumped to stdout goobook dump_contacts
As long as something outputted then you should be golden, otherwise enjoy troubleshooting; there’s not that much you could have done wrong up until this point
Now that you have goobook working, lets integrate it into mutt:
# Add the following to your ~/.mutt/muttrc # Goobook query (google contacts) set query_command="goobook query '%s'" bind editor \t complete-query ## tab completion for contacts# Add contacts to google macro index,pager a "goobook add" "add the sender address to Google contacts" # Reload goobook db macro index,pager gr "!goobook reload\n" "Goobook reload"
Now all you have to do is reload mutt, and enjoy your spoils:
- To search just start an email; and hit your tab key to query the contact database
- To add a new contact for an email you’re reading/have selected just press the letter a
- To reload the goobook database (say you added a contact with your phone, or online); just hit gr in sequence; and enjoy a fresh and up to date goobook database.
On a side note, I seem to be migrating deeper into cli apps, and ditching the gui counterparts. Even though I have a killer computer with a bunch of ram; I figure the cpu cycles can be better spent on something else. And at best case scenario, it might save some of my precious battery life. Expect some more posts I guess about all the new cli things that I’ve setup.

doesnt work
What doesn’t work? I would love to help you out; but a “doesnt work” post doesn’t give me much to work with.
Line 5 of your muttrc should read bind editor \t …. (\t is the TAB key)
Also the muttrc from your last article was found in ~/.mutt/muttrc, and here you reference it as ~/.muttrc, which could be confusing to readers (not sure if it matters for the program)
Thanks for noticing; I fixed it…
No problem, I found this and the previous post very helpful, so thanks for posting :3
[...] http://fsk141.com/gooey-google-contact-goodness-with-mutt << Add Google Contacts to [...]