Unable to set background image using python (2.7.3), bash and gnome3

Posted by malon on Ask Ubuntu See other posts from Ask Ubuntu or by malon
Published on 2012-08-27T19:33:23Z Indexed on 2012/08/27 21:56 UTC
Read the original article Hit count: 645

Filed under:
|
#!/usr/bin/env python
import os
bashCommand = "gsettings set org.gnome.desktop.background picture-uri file:///home/malon/autowallpaperchanger/" + pic_name
print bashCommand
os.system(bashCommand)

Print result:

gsettings set org.gnome.desktop.background picture-uri file:///home/malon/autowallpaperchanger/wallpaper-1252048.jpg

Copying and pasting the print result into a terminal makes the change successfully, so the command is correct, but os.system isn't processing the request correctly for some reason. In the full script (posted below), I use os.system for a different reason immediately before (wget) and that works fine.

Thank you!

Full script: http://pastebin.com/R90GTmBZ

© Ask Ubuntu or respective owner

Related posts about bash

Related posts about python