Action ------ 1. Save a random image as "~/test.png". 2. Run the following Plasma Shell script: var allDesktops = desktops(); print (allDesktops); for (i=0;i<allDesktops.length;i++) { d = allDesktops[i]; d.wallpaperPlugin = "org.kde.image"; d.currentConfigGroup = Array("Wallpaper", "org.kde.image", "General"); d.writeConfig("Image", "file:///home/USERNAME/test.png"); } 3. We see that it changes the wallpaper. 4. Download another random image as "~/test.png", replacing the old one. 5. Run above script again. Expected Behaviour ------------------ The wallpaper is changed, i.e. Plasma reloads the wallpaper. Actual Behaviour ---------------- The wallpaper is the same as the original "~/test.png", and not the new one.
I suspect one possibility this doesn't work is because the config doesn't actually change, so it's not reloaded. If so, a workaround is to use a differently named file each time, that should help ensure that 'writeConfig' actually changes
> d.writeConfig("Image", "file:///home/USERNAME/test.png"); That as Rex says, will just no-op. Changing that is not an option. However, we can agree there should be Does writeConfg("Image", "") writeConfg("Image", "file://blah") work? It'll be only one sync. Failing that maybe we can look at putting file watching into the wallpaper.
Yes, that seems to work. Thank you. File watching for the wallpaper would be an interesting course of action, but I think that'll just spend additional system resources for little benefit. Unless there's a non-polling, easy-on-disk/cpu-usage file watching solution that exists? Perhaps we could just have Plasma reload the wallpaper image every (configurable) N seconds? Notes ----- If one sets the image to a non-existent one, inaccessible one, or just an empty string as given above, Plasma simply keeps using the wallpaper it had previously, until a valid image is set. I haven't tested what happens if you delete the image set as wallpaper, and then restart the computer or log-out-log-in. Probably a blank wallpaper will be displayed.
Cool, can I close this?
Yes, please close it now.
Thanks for the update; closing.