MOTD

Message Of The Day

Mon, 14 Mar 2005

05:20 [zork(~)] cat hacking-the-guhnome.txt

When in doubt...

...hack it yourself.

Since Warty came out I have become a much more hardcore gui desktop user. I've hacked up quite a few Nautilus Scripts to make my life a little easier, but after "losing" a hard drive on my laptop I'm back to basic Nautilus. Now I've hit an annoying missing feature in it yet again.

Nautilus has this nice context menu that pops up for certain file types and allows to do nice things like add a bunch of files to Rhythmbox, make a tarball, or what have you. What they've never had was a way to make an image your desktop background. I know that this a silly thing to get all crazy about, but it really bugs me that it doesn't support this out of the box.

I used to have a script that would do this for me, but it is kinda annoying to have to right click, wait for the menu, then go to the Scripts menu, and wait for it to come up, and then finally click on "Make this my background." Also since it was attached to the scripts menu it could come up for any filetype which seems a little strange since you could ask the system to make an text file your background. It wouldn't do it of course it just seems like a bit of UI there.

So now here's what I want. I want a context menu for images that says "Change Desktop Background to image..." And then does it. And I would prefer to learn as little as possible about the guts of Gnome and Nautilus in the process. And I don't want to have to do it in C, I'd rather do it in python.

So I whip out google and start to figure out how to do this "simple" task. There seems to be a few python-bonobo tutorials out there, mostly working with making panel applets. Bonobo adds this big maze to some of the Gnome stuff. There are a few tools to manipulate it, but it mostly works like a scary black box. And doesn't appear to like making any log messages at all.

So I start taking apart some apps that use the interface namely file-roller. The nautilus source package also has a pdf that contains some documentation on how to build some interfaces. So I start to learn about bonobo. For instance, did you know that bonobo can be used as a primitive medieval torture device? It's true. Also it has something to do with CORBA which accounts for it's rampant insanity. So I try randomly typing strings into vi and started to get some results. The bonobo query whatnot was telling me that yes it knew about my crazy extension, but nautilus still was not using it.

Why nautilus? Why do you hate me so?

Follows is some of the notes that I was taking:

Try some tricks. ltracing nautilus == crash.

Sure would be nice to find out how nautilus pulls these menu items out
of it's ass.  Apparently it doesn't use the bonobo activation the way we think
it should.  libeel.  More nautilus guts.  Also some eel guts.  Remember to wash
hands.

So in the end it looks like someone decided to extricate all of the bonobo bits out of nautilus. Great. No more bonobo. But now there is no easy python way (at least from what I see) to screw around with nautilus.

I guess sometimes when in doubt just keep doing it the lame crappy way. Ok, back to hacking pgscsh. Hacking the guhnome is too hard today.


[zork(~)] cal
[zork(~)] tree
[zork(~)] syndicate.py
[zork(~)] cat README