This forum has been archived. All content is frozen. Please use KDE Discuss instead.

solid color desktop backgroud set from cli

Tags: None
(comma "," separated)
icekool
Registered Member
Posts
1
Karma
0
I want to have my desktop background as a solid color. This can be done using the plasma configuration tool however I want to do this from a script.
I have seen code such as below that changes the wallpaper

#!/bin/sh
js=$(mktemp)
cat > $js <<_EOF
var wallpaper = "$1";
var activity = activities()[0];
activity.currentConfigGroup = new Array("Wallpaper", "image");
activity.writeConfig("wallpaper", "/usr/share/wallpapers/myimage.jpg");
activity.reloadConfig();
_EOF
qdbus org.kde.plasma-desktop /App local.PlasmaApp.loadScriptInInteractiveConsole "$js" > /dev/null
xdotool search --name "Desktop Shell Scripting Console - Plasma Desktop Shell" windowactivate key ctrl+e key ctrl+w
rm -f "$js"

What do I need to alter to have a solid color background instead of a wallpaper image.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
The change you need to make is to swap the following lines:
Code: Select all
activity.currentConfigGroup = new Array("Wallpaper", "image");
activity.writeConfig("wallpaper", "/usr/share/wallpapers/myimage.jpg");

For these instead:
Code: Select all
activity.currentConfigGroup = new Array("Wallpaper", "color");
activity.writeConfig("color1", "0,0,0");


You should change the values 0,0,0 to the values you need (I suspect these are R,G,B values ranging from 0-255 but cannot confirm this). You should be able to use "kdialog --getcolor" to help you determine the values you need.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient