Skip to content

Instantly share code, notes, and snippets.

@mamantoha
Last active May 28, 2024 15:43
Show Gist options
  • Save mamantoha/c01363e5c791e8324d6248b09cf29bbb to your computer and use it in GitHub Desktop.
Save mamantoha/c01363e5c791e8324d6248b09cf29bbb to your computer and use it in GitHub Desktop.
Set desktop wallpaper in Plasma5 via a dbus command
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript 'var allDesktops = desktops(); 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:///path/to/image.png")}'
@guoyunhe
Copy link

It works on KDE 5.9.3. Thanks for sharing!

I have a wallpaper application for KDE which use this code. https://github.com/guoyunhe/unwallpaper

Copy link

ghost commented Dec 19, 2017

This still works on KDE Plasma 5.11.4. The background slideshow function on KDE is currently bugged (huge CPU usage after enabling it) so I made my own slideshow python program to change it using your script. https://i.imgur.com/JFBzaHf.png Thanks very much mamantoha, you saved me a lot of hassle.

@mamantoha
Copy link
Author

This still works with Plasma 5.27.0 🤩

@lostcitizen
Copy link

do you know how to change the filling settings? (croped, keep proportions, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment