Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
if [ -f /usr/share/anon-ws-base-files/workstation ]; then
if cat /proc/cmdline | grep "boot=live"; then
#set wallpaper for workstation live
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript '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/user/wp-live-ws.png")}'
else
#set wallpaper for workstation persistent
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript '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/user/wp-persistent-ws.png")}'
fi
elif [ -f /usr/share/anon-gw-base-files/gateway ]; then
if cat /proc/cmdline | grep "boot=live"; then
#set wallpaper for gateway live
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript '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/user/wp-live-gw.png")}'
else
#set wallpaper for gateway persistent
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript '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/user/wp-persistent-gw.png")}'
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment