wmii gmail check plug-in
Thursday January 25, 2007 by Derek Young
My biggest source of distraction at work is definitely email. I’m constantly switching windows to see if I have new mail. I’ve never found a mail notification program I really liked because they’re either only embedded in a browser or too distracting (defeating the purpose). I wanted something that gives me the information I need (whether I have mail and what it is) but doesn’t jump out at me constantly.
I continue to use the wmii window manager and especially like how it stays out of the way. I have a tiny line of text across the bottom and that’s it. I decided to try my hand at writing a wmii-ruby plug-in to check for new gmail messages (through the Atom interface) and display the sender and subject of my newest message in the applet area. I also added a feature so I can press a key to poll on demand. This way I can check for new messages but also helps clear the status after I’ve read the message.
Hooking into wmii-ruby is simple and clean. For example here’s a very simple hello world applet:
bar_applet('hello', 100) do |wmii, bar|
bar.data = 'hello world'
end
The API allows you to get configuration values, define key bindings, mouse click handlers, etc. You can also start up a thread and update the bar periodically with whatever you want.
The gmail specific code reads the Atom feed they provide through SSL and parses out some information from the first entry.
The code is here. I included instructions for hooking into wmii at the top.

Linux RAID: lessons learned Finally - Linux clipboard integration
