Post to Twitter from Ubuntu Deskbar

Deskbar is a Gnome widget you can embed in a panel and can be used for opening applications, opening items from your browser history, doing web searches and all sorts. It’s not as good as Quicksilver but better than Launchy. It fires when you hit a key combo (mine is CTRL+SPACE) and looks a bit like this:

Screenshot of Deskbar on Ubuntu

For the soulless, Twitter is length limited asynchronous multicast IM, for everyone else, it’s a nice way to keep up to date with what your friends are doing using the web, IM or SMS. My rarely-posted to Twitter page is here.

Lucky for me, Deskbar is easily extendable , and so that’s just what I’ve done. I looked at the Twitter Wiki, found a Python Twitter library downloaded their little icon thing and written a sript to let you post to Twitter from your Deskbar. It looks like this:

Screenshot of Deskbar with Twitter plugin installed

To install:

  1. Install python-twitter
  2. Grab deskbar-twitter.py and twitter.png and put them in ~/.gnome2/deskbar-applet/handlers/
  3. Open your downloaded deskbar-twitter.py in an editor
  4. Replace TWITTER_USERNAME and TWITTER_PASSWORD with your Twitter details
  5. Replace YOUR_USERNAME with your Ubuntu username

It took longer to write this blog post than the code, so patches welcome.