here is a quick way to change the gnome wallpaper from python. The module is importable and can be used in another program.

Creative Commons License
This work is licensed under a Creative Commons GNU General Public License License.

download from: code on pasteall or code from dropbox

the indentation on wordpress is rubbish, so this is just the lines of code without indentation:


#!/usr/bin/env python
import os
def change_wallpaper(imagefile):
cmd = 'gconftool-2 -s /desktop/gnome/background/picture_filename -t string "%s"' % imagefile
os.system(cmd)


if __name__ == '__main__':
change_wallpaper ('background.jpg')

Advertisements