[PyQt] dcop kdesktop KBackgroundIface setWallpaper
Jonas Häggqvist
rasher at rasher.dk
Fri Mar 9 07:55:55 GMT 2007
I'm trying to set the wallpaper from a python script, but not having
much luck. In my search, I found
http://lists.kde.org/?l=pykde&m=115083016831166&w=2 which lists
something that works, most of the way.
The following works:
#Create DCOP clients
import kdecore
import dcopext
dcopclient = kdecore.KApplication.dcopClient()
dcopclient.registerAs("changewp")
dcopapp = dcopext.DCOPApp("kdesktop", dcopclient)
Now comes the problem, actually setting the wallpaper.
dcopapp.KBackgroundIface.setWallpaper("/path/to/file", 3)
This doesn't work, simply returns (False, None). How am I supposed to
pass the arguments? The dcop executable says "void setWallpaper(QString
wallpaper,int mode)", but I believe I've tried just about every possible
combination now (and a few impossible ones).
Or did Richard just leave out some more stuff in his post? I can read
the current wallpaper just fine (and set it using the dcop executable).
I'm using python-kde from Debian unstable (3.15.2+20060422-3, it claims).
--
Jonas H
rasher(at)rasher(dot)dk
More information about the PyQt
mailing list