Reply to topic

solid color desktop backgroud set from cli

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
19746
Karma
85
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]http://forum.kde.org/content/bcooksley_sig.png[/img]

 
Reply to topic

Bookmarks



Who is online

Registered users: AGuiFr, andreas_k, Artmessiah, Baidu [Spider], Bing [Bot], boudewijn, cesartellez, dbcgbdhgc, Exabot [Bot], Google [Bot], hari, Majestic-12 [Bot], paulus3005, renesmaal, Yahoo [Bot]