Javascript to change the default wallpaper in plasma

Raphael Hertzog hertzog at debian.org
Mon Jul 25 19:01:25 UTC 2016


Hello,

I'm a Debian developer trying to fix the plasma integration with default artwork
in Debian (https://bugs.debian.org/831730). I noticed recently that a plasma
install did not have the expected wallpaper and thus that the existing
integration no longer works. The current integration is a file
/usr/share/kde4/apps/plasma-desktop/init/10-destop-base.js:
http://sources.debian.net/src/desktop-base/8.0.2/kde-wallpaper/10-desktop-base.js/

I tried to look out for documentation but the only thing that I did
find is this wiki page and it doesn't seem to be entirely up-to-date:
https://userbase.kde.org/KDE_System_Administration/PlasmaDesktopScripting

For instance, I was not able to run the interactive scripting dialog
with "qdbus org.kde.plasma-desktop /MainApplication
showInteractiveConsole" (it doesn't know about this DBus interface)
so I could not get very far into debugging my issue.

I tried to update the javascript code like this, based on my reading
of ~/.config/plasma-org.kde.plasma.desktop-appletsrc after having changed
the background:

    d = desktops()

    for (i in d) {
	d[i].wallpaperPlugin = 'org.kde.image'
	d[i].currentConfigGroup = Array('Wallpaper', 'org.kde.image', 'General')
	d[i].writeConfig('Image',
		'file:///usr/share/images/desktop-base/desktop-background')
	d[i].writeConfig('FillMode', '2')          //enables croping
    }

But it doesn't seem to work and I don't know why. It's possible that the script
is not executed at all...

Do you know what has changed and what I should fix? Any help/pointer is welcome.

Thank you in advance.
-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/


More information about the Plasma-devel mailing list