my workplace

There's an LCD monitor standing on the desk next to my laptop at work. I use MergedFB to get a combined 1024x786+1280x1024 desktop. (Here's my /etc/X11/xorg.conf if anyone with a Radeon card is interested.)

GNOME doesn't fully understand this setup yet (bug #147808). It thinks I have a single large 2304x1024 desktop, and it sets the wallpaper accordingly. I can tile or stretch an image, but I cannot set separate images for each monitor. And tiling doesn't work well with different monitor resolutions.

What I needed was a tool to take two images, scale them appropriately and paste them together into one large 2304x1024 image. Easy! I did some browsing of the Python Imaging Library online documentation and 45 minutes later I had dualpaper.py, a nice command-line script with robust option parsing.

Encouraged by easy success I took on the next challenge: writing a GUI app so that I could drag and drop a couple of images, hit a button, and get a newly constructed wallpaper. This was a bit harder. I used PyGtk and Glade. I spent some frustrating time trying to locate PyGtk examples (to see how drag&drop works) until I finally located them in /usr/share/doc/python2.4-gtk2/examples/demos/. I spent even more time Googling about Xinerama so that I could automatically determine the size of each monitor, until I discovered gtk.gdk.Screen.get_monitor_geometry. The rest was straightforward, and I had a fully functional prototype in less than 2 hours.

Dual-Head Wallpaper Maker

That's why I love Python: it enables me to achieve results very quickly. (By the way, how do I know this excercise took 2 hours and 34 minutes? GTimeLog!).

Update: the code now has a webpage.