Another few baby steps towards the kimdaba-screensaver (which I'm still not sure I actually have a use for) - changing the foreground of the randomly generated rectangle, and actually putting a JPG image up some of the time.
xss_colorsquares.py has both changes. (Looking for other examples of apps that use both PIL and python-xlib, google code failed me, but a straight google search found a http://www.koders.com search which had a number of useful hints, in the code to the Circus project. The important bits are
ZPixmap
RGBX
or BGRX
mode based on window.display.info.image_byte_order
tostring('raw', mode)
Obviously this isn't fully general, but it handles the
"straight-through" case and I can add any needed details later, if any
of the assert
s fail.
Footnotes: