<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://whijo.net" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>linux</title>
 <link>http://whijo.net/taxonomy/term/30/feed</link>
 <description>The taxonomy view with a depth of 0.</description>
 <language>en</language>
<item>
 <title>Firefox 2 and Firefox 3 co-habiting on Ubuntu 8.04</title>
 <link>http://whijo.net/blog/brad/2008/05/14/firefox-2-and-firefox-3-co-habiting-ubuntu-8-04.html</link>
 <description>I recently upgraded to &lt;a href=&quot;http://ubuntu.com&quot;&gt;Ubuntu&lt;/a&gt; 8.04 (Hardy Heron). I was pleasantly surprised when Firefox 3 greeted me as the default browser, but then hit a few speed bumps. Being a web developer I constantly use tools like &lt;a href=&quot;http://getfirebug.com&quot;&gt;firebug&lt;/a&gt; and MeasureIt. Unfortunately, until Firefox 3 is widespread (and released), many extensions don&#039;t work (there are hacks, but they come with problems). So I don&#039;t want to go back to Firefox 2 as my browser, because when I did try there were some issues with downgrading my profile, and I have become quite used to bookmark tags, awesomebar, the incredible difference in memory consumption, and the Save &amp; Exit prompt. Running Firefox 2 concurrently is possible though, it comes at a price though.

Firstly, install firefox-2:
&lt;pre&gt;&lt;code&gt;sudo apt-get install firefox-2&lt;/code&gt;&lt;/pre&gt;

I went the route of using a separate user for FF2, but you could probably use profiles? So:

Create a candidate user:
&lt;pre&gt;&lt;code&gt;sudo adduser firefox2&lt;/code&gt;&lt;/pre&gt;
(where firefox2 is the username)

Then you can run firefox-2 as the user firefox2 using:
&lt;pre&gt;&lt;code&gt;xhost +local:
sudo su firefox2
export DISPLAY=:0.0
firefox-2&lt;/code&gt;&lt;/pre&gt;

The caution...using xhost +local: means any user logged onto your box (i.e. local), including ssh sessions, can access your X session. You will not have your bookmarks etc., but you can make a copy of bookmarks.html from your ~/.mozilla/firefox/%default profile%/bookmarks.html. You can now install the conventional FF add-ons etc.

This should be treated as a hack and an interim measure, because once FF3 is supported by all your favourite extensions, then there is no need to carry on using it. I use my FF3 as my primary browser, and FF2 as a development environ (so not having bookmarks is fine for me, because I literally only use it for opening the site I am currently working on).

Would appreciate constructive comments and crit. of better ways of doing this.</description>
 <comments>http://whijo.net/blog/brad/2008/05/14/firefox-2-and-firefox-3-co-habiting-ubuntu-8-04.html#comments</comments>
 <category domain="http://whijo.net/geek-tags/firefox">firefox</category>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/geek-tags/mozilla">mozilla</category>
 <category domain="http://whijo.net/geek-tags/sudo">sudo</category>
 <category domain="http://whijo.net/geek-tags/ubuntu">ubuntu</category>
 <pubDate>Wed, 14 May 2008 10:29:11 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">436 at http://whijo.net</guid>
</item>
<item>
 <title>Periodic Status Update (exclaimation, exclaimation, one, exclaimation)</title>
 <link>http://whijo.net/blog/brad/2008/05/02/periodic-status-update-exclaimation-exclaimation-one-exclaimation.html</link>
 <description>Because Blogging has become a secondary industry to Having a Family, and Working, and Living In Cape Town, I figured it was time for a generic status update, for those of you who dont use &lt;a href=&quot;http://twitter.com&quot;&gt;Twitter&lt;/a&gt;, and/or live near me. It is a hodge-podge, so apologies to any random internet search victims who think this page contained what they were looking for.
&lt;!--break--&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;We moved to Cape Town&lt;/strong&gt; at the beginning of the year, for me to take up a position as a &lt;strong&gt;Web Architect&lt;/strong&gt; at &lt;a href=&quot;http://www.openvoice.co.za&quot; &gt;openVOICE&lt;/a&gt;, and for the whijos to start living the Cape Town dream. About a month after I joined OV the decision was taken to split the company into different parts, to maintain focus. I was offered a position in the still to be formed company (which is now called nvent, and for a short time was called Richtrau no. 201). So, the company split, and I started to work for the new company (April 1st). In the run up to the split I became a bit unhappy with the uncertainty involved, and I ran into the problem (which I have had for a while) of being &quot;the Web Guy&quot;, and, while talented and handsome, I am very much keen to be part of a web team, in a web company, to see what it feels like, to have peers who worry about the same things I do, etc. So I put my CV out there, hoping to find a web firm that does &lt;a href=&quot;http://www.python.org&quot;&gt;python&lt;/a&gt; (my one true programming love after pascal). I didn´t find that, but I did find a very nice PHP web firm called &lt;a href=&quot;http://www.persuasionlab.com/&quot;&gt;Persuasion Lab&lt;/a&gt;. So, I interviewed with them, and decided to quit my position at OV/nvent, and take up a position in &lt;acronym title=&quot;Persuasion Lab&quot;&gt;PL&lt;/acronym&gt;.&lt;/li&gt;
&lt;li&gt;Now, &lt;strong&gt;I was not convinced of PL at first&lt;/strong&gt;, on paper, since they specialised in...Online Dating. I chuckled to myself, and decided to give them an interview, since it was either going to be new material at parties, or something genuinely intriguing. They won points out the box because they are located within walking distance of our home. To be honest I was expecting red velvet, and a handful of programmers wearing black silk shirts with long, slicked back pony tails. The former was true, the latter was devastatingly not. I interviewed with the directors of the company, David Burstein (there is only one n in burstein), and Duncan Forrest. They were nice, and I enjoyed the interview (I was unusually nervous, &lt;acronym title=&quot;For no apparent reason&quot;&gt;FNAR&lt;/acronym&gt;). I did a &lt;a href=&quot;http://validator.w3.org/check?uri=http%3A%2F%2Fwww.datingbuzz.co.za%2F&amp;charset=(detect+automatically)&amp;doctype=Inline&amp;group=0&quot;&gt;small amount of research&lt;/a&gt; before I went to the interview, and was satisfied by the info that turned up (even if it is not 100%, 4 errors is better than this web page). So I was pleasantly surprised. They have the online dating game wrapped up in SA, powering most of the newspaper dating sites, including ¨Date Your Destiny¨ IOL dating (which always makes me smile when I read an IOL story). They seem to have grown, or split, out of Ogilvy Interactive (information courtesy of some retrospective facebook research), they have been going since 2000 (which is dog years in the web game), and Duncan seems to have done a lot of the development, and currently still dives into the code (which is something that makes me happy). They have a good number of employees, split over varying roles (which also makes me happy), and they also have a London office, for their British clients. I think I stand to learn a lot there, and hopefully pick up the skills and understanding I will need when I build my own empire.&lt;/li&gt;
&lt;li&gt;We visited JHB for two weeks to go to &lt;strong&gt;Pippa and Vaughn´s not-a-wedding-wedding&lt;/strong&gt;, which was frankly amazing, and, to date, is one of the most heartfelt and enjoyable weddings I have ever been to, but maybe it is just because they invited all our friends. The time we did spend with them we used productively to encourage them to get pregnant, so Fin has friends. We stayed with Pippa and Vaughn, Hannah and Mau, and saw a lot of Marc Bradley Lewis and &lt;abbr title=&quot;Marlise Richter&quot;&gt;Bokkie/Sweetie&lt;/abbr&gt;, Alison Green, caught up with old school friends Marc Patrick Lewis, and Breton VDB, among others. Unfortunately we did not see everyone I would have liked to, but JHB is a big place hey, and, with traffic, two weeks goes by quick.&lt;/li&gt;
&lt;li&gt;In May we are going to visit Grahamstown, to attend the wedding of Mamello Wheee Thinyane, and Dr. Hannah Barbie Sparkles Slay, and I did not want to fork out for the plane trips, so Mandy said we could drive if we had a new car (I am sorry Telburt, I loved you like a man loves a car, and It Was Her Idea). I really wanted a Toyota Prius, but they are PRICY, and still the first generation of hybrids, so I am a bit cautious. Instead, after narrowing down the choice between a low mileage VW Polo Classic, and a low mileage Golf 5, we went with the Golf. The Polo Classic came with mostly the same features, but the Golf FEELS incredible. I find the fittings and interior of the Polos to be quite plasticy, and sensible. So, parked outside our house is possibly the most expensive toy we have ever bought, but shew, it´s nice. I have taken every opportunity to drive it over the long weekend (we recieved it on Wednesday, when I traded Telburt in), including an airport run for Russell and Les. It feels like heaven to drive, and features like being able to wind down the electic windows using the remote blows my mind.&lt;/li&gt;
&lt;li&gt;We bought a new &lt;strong&gt;VW Golf 5&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Over the past few months I have steadily been attending more Geek things, like &lt;a href=&quot;http://clug.org.za&quot;&gt;CLUG&lt;/a&gt; (actually, the first CLUG talk I attended was the one given by &lt;a href=&quot;http://vhata.net&quot;&gt;Jonathan&lt;/a&gt; and Me). Attended two[&lt;a href=&quot;http://wiki.geekdinner.org.za/wiki/Cape_Town_January_2008&quot;&gt;1&lt;/a&gt;][&lt;a href=&quot;http://wiki.geekdinner.org.za/wiki/Cape_Town_March_2008&quot;&gt;2&lt;/a&gt;] &lt;a href=&quot;http://geekdinner.org.za/&quot;&gt;Geek Dinner(s)&lt;/a&gt;, during the second of which I did slideshow karaoke, and designed the &lt;a href=&quot;http://wiki.geekdinner.org.za/wiki/Image:Garrulousgrape.120.png&quot;&gt;random grape graphic&lt;/a&gt; (&lt;a href=&quot;http://wiki.geekdinner.org.za/wiki/Image:Garrulous_Grape.svg&quot;&gt;SVG here&lt;/a&gt;, needs gradients and blur filters) using &lt;a href=&quot;http://inkscape.org&quot;&gt;inkscape&lt;/a&gt;. There are some blog posts about GeekDinner on &lt;a href=&quot;http://planet.geekdinner.org.za/&quot;&gt;Planet Geekdinner&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;I upgraded to Ubuntu 8.04 ´Hardy Heron´, and I am in love with Linux once again (every six months Ubuntu re-ignites the spark)&lt;/li&gt;
&lt;li&gt;I have accounts on, and I am going to write for, &lt;a href=&quot;http://ilovemylinux.com&quot; title=&quot;I love my linux&quot;&gt;ILML&lt;/a&gt; (the brainchild of my brother Kyle, and his mates), and the still-to-be-launched &lt;a href=&quot;http://techleader.co.za&quot;&gt;TechLeader&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

That should cover it for now, thanks for your patience and I hope you enjoyed your stay.</description>
 <comments>http://whijo.net/blog/brad/2008/05/02/periodic-status-update-exclaimation-exclaimation-one-exclaimation.html#comments</comments>
 <category domain="http://whijo.net/tags/current-status">current status</category>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/tags/golf-v">Golf V</category>
 <category domain="http://whijo.net/geek-tags/ilml">ilml</category>
 <category domain="http://whijo.net/tags/life">life</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/tags/peopleware">Peopleware</category>
 <category domain="http://whijo.net/tags/persuasion-lab">Persuasion lab</category>
 <category domain="http://whijo.net/geek-tags/php">php</category>
 <category domain="http://whijo.net/geek-tags/python">python</category>
 <category domain="http://whijo.net/geek-tags/tech-leader">tech leader</category>
 <category domain="http://whijo.net/tags/whijos">whijos</category>
 <pubDate>Fri, 02 May 2008 19:59:39 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">433 at http://whijo.net</guid>
</item>
<item>
 <title>GNOME Blueslick</title>
 <link>http://whijo.net/blog/brad/2008/04/04/gnome-blueslick.html</link>
 <description>&lt;span class=&quot;inline&quot;&gt;&lt;a href=&quot;http://whijo.net/files/gnome-blueslick-1280x800.png&quot; class=&quot;inline-image-link&quot; title=&quot;View: gnome-blueslick-1280x800.png&quot; rel=&quot;lightbox[gp_inline]&quot;&gt;&lt;img src=&quot;http://whijo.net/files/imagecache/inline_resize/files/gnome-blueslick-1280x800.png&quot; alt=&quot;gnome-blueslick-1280x800.png&quot; title=&quot;gnome-blueslick-1280x800.png&quot;  class=&quot;inline&quot; /&gt;&lt;/a&gt;&lt;/span&gt;

I just entered the &lt;a href=&quot;http://www.cimitan.com/contest/&quot;&gt;GNOME 2.24 wallpaper competition&lt;/a&gt;, attached is my entry. I would appreciate critism, and suggestions. If you like it, use it, and share it!

Attached are more resolutions, and original SVGs. I built the SVGs using &lt;a href=&quot;http://inkscape.org&quot;&gt;Inkscape 0.46&lt;/a&gt;</description>
 <comments>http://whijo.net/blog/brad/2008/04/04/gnome-blueslick.html#comments</comments>
 <category domain="http://whijo.net/tags/background">background</category>
 <category domain="http://whijo.net/geek-tags/background">background</category>
 <category domain="http://whijo.net/tags/blue">blue</category>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/gnome">gnome</category>
 <category domain="http://whijo.net/geek-tags/inkscape">inkscape</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/tags/wallpaper">wallpaper</category>
 <enclosure url="http://whijo.net/files/gnome-blueslick.zip" length="1066903" type="application/zip" />
 <pubDate>Fri, 04 Apr 2008 11:19:15 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">429 at http://whijo.net</guid>
</item>
<item>
 <title>Intrepid Ibex</title>
 <link>http://whijo.net/blog/brad/2008/02/21/intrepid-ibex.html</link>
 <description>&lt;span class=&quot;inline&quot;&gt;&lt;a href=&quot;http://whijo.net/files/nubianibex.jpg&quot; class=&quot;inline-image-link&quot; title=&quot;View: A Nubian Ibex, from http://commons.wikimedia.org/wiki/Image:Capra_ibex_ibex_%E2%80%93_02.jpg&quot; rel=&quot;lightbox[gp_inline]&quot;&gt;&lt;img src=&quot;http://whijo.net/files/imagecache/inline_resize/files/nubianibex.jpg&quot; alt=&quot;A Nubian Ibex, from http://commons.wikimedia.org/wiki/Image:Capra_ibex_ibex_%E2%80%93_02.jpg&quot; title=&quot;A Nubian Ibex, from http://commons.wikimedia.org/wiki/Image:Capra_ibex_ibex_%E2%80%93_02.jpg&quot;  class=&quot;inline&quot; /&gt;&lt;/a&gt;&lt;/span&gt;
In celebration of the &lt;a href=&quot;https://lists.ubuntu.com/archives/ubuntu-devel/2008-February/025136.html&quot;&gt;newly announced&lt;/a&gt; &quot;Intrepid Ibex&quot; (or Ubuntu 8.10), I once again bring your attention to my &lt;a href=&quot;http://whijo.net/node/116&quot;&gt;python script which generates alternative Ubuntu names&lt;/a&gt;. I brute forced some names starting with I and came up with these alternatives (which suggests maybe Intrepid Impala would be a nicer name for 8.10).&lt;!--break--&gt; So, 
&lt;pre&gt;&lt;code&gt;radbrad@renton:~/python/ubuntu/choose_ubuntu$ while ((1));do python namer.py |grep ^I; done;
Inspirational Insect
Insolent Imp
Inexpensive Imp
Illustrious Ichthyosaur
Ingenious Indri
Incredible Impala
Immense Inkanyamba
Insurgent Ibis
Indefatigable Insect
Inescapable Ichthyosaur
Impressive Ichthyosaur
Inquisitive Imp
Ignited Impala
Ineffable Imp
Inevitable Insect
Inquisitive Ibis
Immodest Imp
Incomparable Ibex
Incredible Ichthyosaur
Ill Insect
Impressive Ibex
Indefatigable Ichthyosaur
Icky Iceweasel
&lt;/code&gt;&lt;/pre&gt;

Like the kubuntu, xubuntu, gubuntu names &lt;a href=&quot;http://www.tectonic.co.za/?p=2053&quot;&gt;confuse newbies and make Ubuntu difficult to market&lt;/a&gt;. I dig the naming scheme, just not the names that come out of it.

Also, &lt;a href=&quot;http://www.theregister.co.uk/2008/02/20/ubuntu_intrepid_ibex/&quot;&gt;the register points out&lt;/a&gt; that:
&lt;blockquote src=&quot;http://www.theregister.co.uk/2008/02/20/ubuntu_intrepid_ibex/&quot;&gt;&lt;p&gt;We&#039;re informed that a male ibex will try and tempt a female into sex by licking and sniffing the lass and by issuing a low scream. It&#039;s suspected that Bono responds to a similar ritual. Sometimes the female will demonstrate her interest by urinating or by ramming the male with her horns. The male then returns the favor through the flehmen response, which is a curling of the upper lip. This goes on for about 30 minutes until Bono shows up or the ibexes get it on.&lt;/p&gt;&lt;/blockquote&gt;</description>
 <comments>http://whijo.net/blog/brad/2008/02/21/intrepid-ibex.html#comments</comments>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/geek-tags/python">python</category>
 <category domain="http://whijo.net/geek-tags/ubuntu">ubuntu</category>
 <pubDate>Thu, 21 Feb 2008 10:09:42 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">426 at http://whijo.net</guid>
</item>
<item>
 <title>Hardy Heron</title>
 <link>http://whijo.net/blog/brad/2007/09/02/hardy-heron.html</link>
 <description>&lt;div style=&quot;text-align:center&quot;&gt;[flickr-photo:id=146001589,size=m]&lt;/div&gt;
In celebration of the &lt;a href=&quot;http://www.jonobacon.org/?p=1017&quot;&gt;newly announced&lt;/a&gt; &quot;Hardy Heron&quot; version of Ubuntu (8.04) I built a script to randomly generate a name for Ubuntu releases. &lt;del&gt;I did not have a huge corpus of animal names, and I tried to find as many adjectives as I could find, but&lt;/del&gt; &lt;ins&gt;I used the adjectives and animals from &lt;a href=&quot;https://wiki.ubuntu.com/DevelopmentCodeNames&quot;&gt;the ubuntu wiki&lt;/a&gt;, and&lt;/ins&gt; here is the script in all it&#039;s glory&lt;!--break--&gt;:
&lt;pre&gt;&lt;code&gt;import re
from random import randrange

def get_adjectives():
        f = open(&#039;adjectives&#039;,&#039;r&#039;)
        adjectives = f.readlines()
        f.close()
        return adjectives

def get_animals():
        f = open(&#039;animals&#039;,&#039;r&#039;)
        animals = f.readlines()
        f.close()
        return animals

def choose_adjective(adjectives):
        return adjectives[randrange(len(adjectives))].strip()

def choose_ubuntu(adjectives,animals):
        adj = choose_adjective(adjectives)
        letter = &#039;^%s&#039; % adj[0]
        letter = re.compile(letter)
        animal = [i for i in animals if letter.match(i)]
        if animal == []:
                return choose_ubuntu(adjectives,animals)
        if len(animal)&gt;1:
                animal = animal[randrange(len(animal))].strip()
        else:
                animal = animal[0].strip()
        return [adj,animal]

adjectives = get_adjectives()
animals = get_animals()
ubuntu = choose_ubuntu(adjectives,animals)

print(&#039;%s %s&#039; % (ubuntu[0],ubuntu[1]))&lt;/code&gt;&lt;/pre&gt;

The script and the animal and adjective corpusesses (not sure of the plural of corpus) are attached in a zipfile.

P.S. I would have preferred a name like Happy Hummingbird, or something that doesn&#039;t sound so much like &lt;a href=&quot;http://images.google.com/images?q=hadeda+ibis&quot;&gt;Hadeda&lt;/a&gt; (the reference to a bird does not help it&#039;s case). Surely in light of Hoary Hedgehog they should skip H entirely?</description>
 <comments>http://whijo.net/blog/brad/2007/09/02/hardy-heron.html#comments</comments>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/geek-tags/python">python</category>
 <category domain="http://whijo.net/geek-tags/ubuntu">ubuntu</category>
 <enclosure url="http://whijo.net/files/choose_ubuntu.zip" length="6029" type="application/zip" />
 <pubDate>Sun, 02 Sep 2007 15:37:04 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">116 at http://whijo.net</guid>
</item>
<item>
 <title>Hey Rhythmbox, go pause yourself!</title>
 <link>http://whijo.net/blog/brad/2007/07/26/hey-rhythmbox-go-pause-yourself.html</link>
 <description>A while back &lt;a href=&quot;http://nxsy.org/blog/archives/2007/03/20/getting-amarok-to-pause-when-the-screen-locks-using-python-of-course&quot;&gt;NBM wrote a script to pause Amarokk when his screensaver turned on&lt;/a&gt;. Since I get competitive I felt I could do it better, and do it for the media player that I love, &lt;a href=&quot;http://www.gnome.org/projects/rhythmbox/&quot;&gt;Rhythmbox&lt;/a&gt;. If you are wondering what purpose this really serves, imagine you are away from your desk for a long time, you want to make sure the music is the same when you come back, and you don&#039;t want to bug any co-workers. It also serves the purpose of deepening my understanding of python, and scratches the itch of customising desktops (and feeling better than windows people). So...

I started out writing a daemonisd script like the one &lt;acronym title=&quot;Neil Blakey-Milner&quot;&gt;nbm&lt;/acronym&gt; built, which listens on the d-bus (the Linux/Freedesktop inter-process messaging/control bus), and connects to Rhythmbox on the same bus to get in control. &lt;a href=&quot;http://nxsy.org/blog/archives/2007/03/20/getting-amarok-to-pause-when-the-screen-locks-using-python-of-course#comment-5167&quot;&gt;Taking his script and changing the message passing&lt;/a&gt; to point to &lt;acronym title=&quot;Rhythmbox&quot;&gt;RB&lt;/acronym&gt; instead of Amarokk was trivial (but a mission due to lack of documentation) and I threw in some improvements.

Then I got itchy and figured I could write a plugin for RB and push control of the functionality to RB (where it belongs), and drop the need for a daemon script. So I opened up the artdisplay plugin for Rhythmbox (since it is a python based plugin) to get an idea of what is involved. After browsing through the plugin, and reading the &lt;a href=&quot;http://live.gnome.org/RhythmboxPlugins/WritingGuide&quot;&gt;Rhythmbox plugins writing guide&lt;/a&gt; I rolled my own.

I call my plugin dbusevents because while it pauses when the screen saver is on it could be extended to support multiple events and actions (maybe you want the volume turned up louder when you first plug in your mouse so you can party). So, a Rhythmbox plugin inhabits a directory and has atleast two parts: A descriptor file, and the plugin.

You can download the whole thing: &lt;a href=&quot;http://whijo.net/files/dbusevents.tar.gz&quot; title=&quot;Download: dbusevents.tar.gz (1.42 KB)&quot;&gt;dbusevents.tar.gz&lt;/a&gt;. To use it drop the extracted directory in /usr/lib/rhythmbox/plugins/

My descriptor file looks like:
&lt;pre&gt;&lt;code&gt;[RB Plugin]
Loader=python
Module=dbusevents
IAge=1
Name=DBUS Events
Name[en_GB]=DBUS Events
Description=Connects Rhythmbox actions to DBUS events (for e.g. pausing when the screensaver is on)
Description[en_GB]=Connects Rhythmbox actions to DBUS events (for e.g. pausing when the screensaver is on)
Authors=Bradley Whittington &lt;brad@whijo.net&gt;
Copyright=Copyright © 2007 Bradley Whittington
Website=http://www.rhythmbox.org
&lt;/code&gt;&lt;/pre&gt;
Pretty straightforward stuff eh? The net result is:
&lt;span class=&quot;inline&quot;&gt;&lt;a href=&quot;http://whijo.net/files/rhythmbox-dbus-config.png&quot; class=&quot;inline-image-link&quot; title=&quot;View: rhythmbox-dbus-config.png&quot; rel=&quot;lightbox[gp_inline]&quot;&gt;&lt;img src=&quot;http://whijo.net/files/imagecache/inline_resize/files/rhythmbox-dbus-config.png&quot; alt=&quot;rhythmbox-dbus-config.png&quot; title=&quot;rhythmbox-dbus-config.png&quot;  class=&quot;inline&quot; /&gt;&lt;/a&gt;&lt;/span&gt;

The meat of the plugin is contained in dbusevents/__init__.py which implements a Rhythmbox plugin, which means it inherits from rb.plugin (import rb), implements at least __init__, activate, and deactivate.

So:
&lt;pre&gt;&lt;code&gt;class DbusEventsPlugin (rb.Plugin):
#Initialisation 
        def __init__ (self):
                rb.Plugin.__init__ (self)

        def activate (self, shell):
                self.shell = shell
                self.rb = shell.get_player ()
                self.session_bus = dbus.SessionBus()
                self.load_events()
                self.connect_events()

        def deactivate (self, shell):
                self.disconnect_events()
                self.save_events()
                self.shell = None
                self.rb = None
                self.session_bus = None
&lt;/code&gt;&lt;/pre&gt;

When my plugin is told to activate it assigns self.rb to an instance of the Rhythmbox shell, makes a connection to the D-BUS session bus, and assigns the instance to self.session_bus, then it calls load_events (which could load events and actions from a config file), and finally connect_events which tells the session_bus which functions to call when certain events happen. The deactivate function does everything, in reverse ;). Ultimately I would like to make a configuration dialogue which allows you to have your custom event-action set up, but I havent found anything more beyond pausing when the screensaver is on.

The magic in connect_events and disconnect_events is pretty basic, at the moment it walks a dictionary with relevant information:
&lt;pre&gt;&lt;code&gt;        events = {
                        &#039;Screensaver Play/Pause&#039;:{
                                &#039;__doc__&#039;:&#039;Pauses Rhythmbox when the Screensaver is running&#039;,
                                &#039;handler&#039;:&#039;playPause&#039;,
                                &#039;signal&#039;:(&#039;SessionIdleChanged&#039;,&#039;org.gnome.ScreenSaver&#039;),
                                &#039;enabled&#039;:True,
                        }
                }
&lt;/code&gt;&lt;/pre&gt;
The functions use self.session_bus.add_signal_receiver and self.session_bus.remove_signal_receiver to attach events to actions. I have only defined a PlayPause function at the moment:
&lt;pre&gt;&lt;code&gt;        def playPause(self,state):
                if not state:
                        if self.wasplaying:
                                self.rb.play()
                else:
                        self.wasplaying = self.rb.get_playing()
                        self.rb.pause()
&lt;/code&gt;&lt;/pre&gt;
Which checks if it is playing when the screensaver is turned on, and pauses if it is, and unpauses when the screensaver turns off, if it was paused when the screensaver went on.

I would appreciate feedback, so drop me a comment if you have any!</description>
 <comments>http://whijo.net/blog/brad/2007/07/26/hey-rhythmbox-go-pause-yourself.html#comments</comments>
 <category domain="http://whijo.net/geek-tags/d-bus">d-bus</category>
 <category domain="http://whijo.net/geek-tags/gnome-screensaver">gnome-screensaver</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/geek-tags/python">python</category>
 <category domain="http://whijo.net/geek-tags/rhythmbox">rhythmbox</category>
 <category domain="http://whijo.net/geek-tags/xscreensaver">xscreensaver</category>
 <enclosure url="http://whijo.net/files/dbusevents.tar.gz" length="1453" type="application/x-gzip" />
 <pubDate>Thu, 26 Jul 2007 16:41:49 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">109 at http://whijo.net</guid>
</item>
<item>
 <title>Python and cybersmart Caps</title>
 <link>http://whijo.net/blog/brad/2007/06/24/python-and-cybersmart-caps.html</link>
 <description>I recently got DSL at home (&lt;a href=&quot;http://nml.ru.ac.za/blog/brad/2007/05/24/one-goes-out-telkom.html&quot;&gt;after 22 working days&lt;/a&gt;), and signed up with a local ISP (&lt;a href=&quot;http://www.cybersmart.co.za&quot;&gt;cybersmart&lt;/a&gt; - you can tell them bwhittington@cybersmart.co.za referred you) because it was the &lt;a href=&quot;http://www.hellkom.co.za/ispprices/adsl-3gb.php&quot;&gt;cheapest 3 Gig cap&lt;/a&gt; available. What I also like about them is they provide a very simple web page that helps you keep track of your usage. I knew a bit of python, and I wanted to further my skills, so I decided to tap out a python script to bring my cap usage to the desktop. The result:

&lt;span class=&quot;inline&quot;&gt;&lt;a href=&quot;http://whijo.net/files/cybersmart-cap.png&quot; class=&quot;inline-image-link&quot; title=&quot;View: cybersmart-cap.png&quot; rel=&quot;lightbox[gp_inline]&quot;&gt;&lt;img src=&quot;http://whijo.net/files/imagecache/inline_resize/files/cybersmart-cap.png&quot; alt=&quot;cybersmart-cap.png&quot; title=&quot;cybersmart-cap.png&quot;  class=&quot;inline&quot; /&gt;&lt;/a&gt;&lt;/span&gt;
&lt;!--break--&gt;

What this re-iterated for me is that python is awesome, linux is awesome, gnome is awesome, and python is awesome. You can get python wrappers for just about everything, and more and more programs include python as an avenue to build extensions (my first non-django, python project was a rhythmbox plugin that pauses the music when your screensaver turns on). 

So I started out on the problem. It was a pretty straightforward issue: download the html from cybersmart, walk the &lt;abbr title=&quot;Document Object Model&quot;&gt;DOM&lt;/abbr&gt;, grab the elements with the relevant data, typecast the data to a floating point number, and, for cream, calculate daily averages (per day usage, per day remaining). Finally, display the data. For this little project I used urllib, pyxml, pynotify (a thin wrapper around libnotify), datetime and time (you can download the full file as an attachment to this blog post).

We start with the data, the cybersmart page looks like this:

&lt;span class=&quot;inline&quot;&gt;&lt;a href=&quot;http://whijo.net/files/cap-summary.png&quot; class=&quot;inline-image-link&quot; title=&quot;View: cap-summary.png&quot; rel=&quot;lightbox[gp_inline]&quot;&gt;&lt;img src=&quot;http://whijo.net/files/imagecache/inline_resize/files/cap-summary.png&quot; alt=&quot;cap-summary.png&quot; title=&quot;cap-summary.png&quot;  class=&quot;inline&quot; /&gt;&lt;/a&gt;&lt;/span&gt;

The relevant bits of information are the &quot;Used for this month&quot; and &quot;Total left for month&quot;. Luckily these are stored in elements with class names that are relevant (although they do reuse the same class name for multiple things, instead of doing a class=&quot;used usedTotal&quot; and a class=&quot;remaining remainingTotal&quot;, and styling the relevant classes, while getting the semantic meaning, and visual identity across). 

So, we download the file (sending relevant log in details as a POST), and send it to the HtmlReader class of pyxml:
&lt;pre&gt;&lt;code&gt;print(&quot;Downloading HTML&quot;)
data = urllib.urlencode(
  {   &quot;accountName&quot;:&quot;account@cybersmart.co.za&quot;,
      &quot;password&quot;:&quot;password&quot;,
      &quot;login&quot;:&quot;login&quot;})
f = urllib.urlopen(
      &quot;http://www.cybersmart.co.za/getAccountDetails.cgi&quot;,
      data
    )
doc = f.read()
f.close()
reader= HtmlLib.Reader()
&lt;/code&gt;&lt;/pre&gt;

Then we parse the document, and walk the DOM tree, pulling out relevant info (sidebar: I couldn&#039;t do this more efficiently than pulling out all the td&#039;s and then checking each class entry, the getElementByClass doesn&#039;t seem to work out properly?? I also cheat because there are multiple savedTotal elements, but I am only worried about the last one):
&lt;pre&gt;&lt;code&gt;print(&quot;Parsing Document&quot;)
dom = reader.fromString(doc)

print(&quot;Walking the tree&quot;)
td_elements = dom.getElementsByTagName(&quot;td&quot;)
remaining=&#039;&#039;
used=&#039;&#039;
for td in td_elements:
        temp = td.attributes.getNamedItem(&#039;class&#039;)
        if temp:
                if temp.value == &quot;savedTotal&quot;:
                        remaining=collect_text(td)
                if temp.value == &quot;usedTotal&quot;:
                        used=collect_text(td)

&lt;/code&gt;&lt;/pre&gt;

Now we have strings in our &quot;remaining&quot; and &quot;used&quot; variables which we can easily typecast to floats and process them further. I used some helper functions that I found on the net for dealing with number of days past and remaining in the month, I didn&#039;t note where they came from, so apologies to the author.

&lt;pre&gt;&lt;code&gt;print(&quot;Caluclating averages&quot;)
daysleft = 
    mkLastOfMonth(datetime.datetime.now())-datetime.datetime.now()
daysleft = daysleft.days
remaining_float = float(remaining)
used_float = -float(used)
days = int(datetime.datetime.now().strftime(&quot;%d&quot;))
&lt;/pre&gt;&lt;/code&gt;

Then, the magic...displaying the data as a notification bubble is flipping simple, you just import pynotify, initialise it with your namespace, and tell it what to display. You can get wrappers that allow you more flexibility for your notification (like images etc.), but I didn&#039;t need it.

&lt;pre&gt;&lt;code&gt;print(&quot;Displaying data&quot;)
usage=
   &quot;&lt;b&gt;%.2f Gb&lt;/b&gt; used in &lt;b&gt;%s&lt;/b&gt; days\nUsage average of &lt;b&gt;%.2f Mb&lt;/b&gt;&quot; % 
   (used_float,days,(used_float*1000)/days)

projected=
   &quot;\n\n&lt;b&gt;%s&lt;/b&gt; days left to use &lt;b&gt;%s Gb&lt;/b&gt;\ndaily allowance of &lt;b&gt;%.2f Mb&lt;/b&gt;&quot; % 
   (daysleft,remaining,(remaining_float*1000)/daysleft)

content = &#039;&#039;.join([usage,projected])
pynotify.init(&quot;cybersmart&quot;)
n = pynotify.Notification(&quot;Cybersmart Remaining Cap&quot;,content)
n.show()
&lt;/code&gt;&lt;/pre&gt;

It is not the most wonderful, or extensible code ever, but it works for me, and hopefully this can help someone else do something else. I would like to find a platform agnostic way to do notifications, and I have found some code to build a platform agnostic systray icon (which could keep track of you usage daily as a graph, and pop up a detailed notification when clicked). Splitting the code into classes would allow it to become more extensible in that multiple ISPs could be catered for using different approaches, with the same display code. 

I am stoked with how easy it was to roll it together (POSTing, downloading, parsing, processing and display in just over 30 lines), how easy it was to hook into libnotify (the freedesktop notification lib) for display. I have upgraded from edgy to feisty (which bumped python from 2.4 to 2.5) and it wasn&#039;t bothered either. You will need to install python-xml, and python-notify. The nice thing is that this is also an appropriate area for python, since it is just message passing.

&lt;add&gt;&lt;em&gt;Update 24/06/2007 - &lt;a href=&quot;http://vhata.rucus.net&quot;&gt;Jonathan&lt;/a&gt; pointed out &lt;a href=&quot;http://www.crummy.com/software/BeautifulSoup/&quot;&gt;BeautifulSoup&lt;/a&gt; as a more appropriate alternative to htmllib&lt;/em&gt;&lt;/add&gt;

As a side note, I fell in love with &lt;a href=&quot;http://www.python.org&quot;&gt;python&lt;/a&gt; when I learnt it so I could program in &lt;a href=&quot;http://www.djangoproject.com&quot;&gt;Django&lt;/a&gt;. I have slowly been trying to spread my python wings beyond simply writing web apps, because it is a flipping rad language, with awesome readability, and crazy power. I suppose you could say I script in python, because python is interpreted at run time, then all the java programmers are scriptors too, so ne ner ne ner ne ner. 
</description>
 <comments>http://whijo.net/blog/brad/2007/06/24/python-and-cybersmart-caps.html#comments</comments>
 <category domain="http://whijo.net/tags/cybersmart">cybersmart</category>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/gnome">gnome</category>
 <category domain="http://whijo.net/tags/internet">internet</category>
 <category domain="http://whijo.net/tags/isp">ISP</category>
 <category domain="http://whijo.net/geek-tags/lazyweb">lazyweb</category>
 <category domain="http://whijo.net/geek-tags/libnotify">libnotify</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/geek-tags/python">python</category>
 <category domain="http://whijo.net/geek-tags/snippet">snippet</category>
 <category domain="http://whijo.net/geek-tags/tutorial">tutorial</category>
 <enclosure url="http://whijo.net/files/cybersmart.py_.txt" length="2433" type="text/plain" />
 <pubDate>Sun, 24 Jun 2007 10:07:17 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">99 at http://whijo.net</guid>
</item>
<item>
 <title>D-arb 1; Active Directory 0</title>
 <link>http://whijo.net/blog/brad/2006/09/27/d-arb-1-active-directory-0.html</link>
 <description>&lt;p&gt;I work in a department which runs it&#039;s network using a windows domain controller (active directory). Now, as it stands, Samba can operate as a drop in ADS for a lot of cases, so it&#039;s ADS is pretty good. The major limitation to Samba&#039;s support is lack of DFS (Dynamic file share), the Microsoft equvalent of network symlinks. But that is not what this article is about.&lt;/p&gt;

&lt;p&gt; Every few weeks my domain password expires. If you remember to change your password before it expires, then no problem, you can use smb, or net. Unfortunately I usually forget (since I use samba so infrequently), and then it means a trip to my nearest domain computer, to change my password, and back. I decided to take action. I dropped a sh script in /etc/cron.daily/ called &#039;rucsict&#039;. The magic is simple:
&lt;pre&gt;
#!/bin/sh
/usr/bin/net -U Username%Password -S the.domain.controller RAP PASSWORD Username Password Password

&lt;/pre&gt;
So every day it refreshes my password. It could easily generate a new password every two weeks or something, but I am more worried about saving myself a trip every few weeks to change my password. So, I win.&lt;/p&gt;</description>
 <comments>http://whijo.net/blog/brad/2006/09/27/d-arb-1-active-directory-0.html#comments</comments>
 <category domain="http://whijo.net/geek-tags/active-directory">active directory</category>
 <category domain="http://whijo.net/geek-tags/bash">bash</category>
 <category domain="http://whijo.net/geek-tags/dfs">dfs</category>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <pubDate>Wed, 27 Sep 2006 16:15:59 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">399 at http://whijo.net</guid>
</item>
<item>
 <title>Ogg/MP3 players</title>
 <link>http://whijo.net/blog/brad/2005/09/27/ogg-mp3-players.html</link>
 <description>&lt;p style=&quot;clear:both&quot;&gt;Firstly, screw the iPod-whatever-bollocks-marketting-gimmicky-piece-of-crap-they-are-selling-now, Does one go for:
&lt;div&gt;&lt;img src=&quot;http://radbrad.rucus.net/news/images/IOPS_Z5_1GB_Black.jpeg&quot;/&gt;&lt;a href=&quot;http://www.pricerunner.co.uk/sound-and-vision/personal-audio/mp3-players/460135/details&quot; class=&quot;external&quot;&gt;1Gb, 12 hours of play, with a high colour screen, and MPEG/DivX playback&lt;/a&gt; @ Â£119&lt;/div&gt; VS. 
&lt;div&gt;&lt;img src=&quot;http://radbrad.rucus.net/news/images/ISM_I-Bead_400_1GB.jpeg&quot;/&gt;&lt;a href=&quot;http://www.pricerunner.co.uk/sound-and-vision/personal-audio/mp3-players/281147/details&quot; class=&quot;external&quot;&gt;1Gb, 25 hours of play from 3 hours charge, and a small OLED screen&lt;/a&gt; @ Â£114.95&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt; The two players are almost identical, dimensions, storage, price etc. They are incredibly small, and both manufactured in korea. The First option is cute and all, but would I really even be able to use the tiny screen for video?&lt;/p&gt;

&lt;p&gt;Of course these are all fun and games, but naught without a &lt;a href=&quot;http://www.have2have.co.za/product_info.php?products_id=234&quot;&gt;Belkin Tunecast II&lt;/a&gt;, so you can listen on the radio&lt;/p&gt;
</description>
 <comments>http://whijo.net/blog/brad/2005/09/27/ogg-mp3-players.html#comments</comments>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/i-bead">i-bead</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/geek-tags/mp3-players">mp3 players</category>
 <category domain="http://whijo.net/geek-tags/ogg">ogg</category>
 <pubDate>Tue, 27 Sep 2005 12:12:55 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">363 at http://whijo.net</guid>
</item>
<item>
 <title>Miguel Ghobangieno is an idiot</title>
 <link>http://whijo.net/blog/brad/2005/07/20/miguel-ghobangieno-idiot.html</link>
 <description>&lt;p&gt; I have never wanted to really start a meme, or a blogmob, but this guy is a real tonsil. I initially heard about him when &lt;a href=&quot;http://mandebach.blogspot.com&quot; class=&quot;external&quot;&gt;Mandy&lt;/a&gt; forwarded an email he sent to the linuxchix mailinglist. Basically he feels that womens rights, feminism, etc. are all things which should disappear. You can see some pearler work by him on the debian-woman mailing list, &lt;a href=&quot;http://lists.debian.org/debian-women/2005/07/threads.html&quot; class=&quot;external&quot;&gt;here&lt;/a&gt; (there are a few posts by him, just look for his name). Clearly he is trolling under a pseudonym, or he is just a dick. I just wonder who the hell he thinks he is that he feels he can speak for a debian community, or linux, or free software community, when in fact he has little or no Internet presence, I bet he barely even knows how to use a computer, let alone decide who should and should not be able be valueable members to a community.&lt;/p&gt;

&lt;p&gt; Personally i think he has had some nasty experience with women before, or he is just a teenager being a tonsil. Miguel, if you are listening, realise that gender oppression is a very real thing, and stop being a dick. &lt;/p&gt;</description>
 <comments>http://whijo.net/blog/brad/2005/07/20/miguel-ghobangieno-idiot.html#comments</comments>
 <category domain="http://whijo.net/geek-tags/debian">debian</category>
 <category domain="http://whijo.net/geek-tags/free-software">free software</category>
 <category domain="http://whijo.net/tags/geek">geek</category>
 <category domain="http://whijo.net/geek-tags/internet">internet</category>
 <category domain="http://whijo.net/geek-tags/linux">linux</category>
 <category domain="http://whijo.net/geek-tags/miguel-ghobangieno">Miguel Ghobangieno</category>
 <pubDate>Wed, 20 Jul 2005 15:05:42 +0200</pubDate>
 <dc:creator>brad</dc:creator>
 <guid isPermaLink="false">339 at http://whijo.net</guid>
</item>
</channel>
</rss>
