Created
November 8, 2020 07:44
-
-
Save marguerite/34d687cfaa88888f17bc0777a1c40509 to your computer and use it in GitHub Desktop.
Plasma 5 Desktop Scripting: Change Wallpaper in InteractiveConsole
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (i in activities()) { | |
activityID = activities()[i]; | |
desktops = desktopsForActivity(activityID) | |
for (j in desktops) { | |
desktop = desktops[j]; | |
desktop.wallpaperPlugin = "org.kde.image"; | |
desktop.wallpaperMode = "Scaled and Cropped"; | |
desktop.currentConfigGroup = new Array("Wallpaper", "org.kde.image", "General"); | |
desktop.writeConfig("Image", "file:///home/zhou/Pictures/Bing/AlpineLarches_ZH-CN10557456981_1920x1200.jpg"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the latest plasma5 is activity based, so the old "desktop()" function will get nothing. you should get activities first to get the available desktops. tested on plasma 5.20.2
reference: https://userbase.kde.org/KDE_System_Administration/PlasmaTwoDesktopScripting