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
18669
Karma
83
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.


System Settings and Device Actions KCM maintainer
Image

 
Reply to topic

Bookmarks



Who is online

Registered users: Alastair, apater, Baidu [Spider], Bing [Bot], Exabot [Bot], garthecho, ggael, Google [Bot], google01103, Horus, jitseniesen, Joif, kde-jriddell, ken300, La Ninje, Mamarok, mmistretta, Nuc!eoN, psbot [Picsearch], rbruce, renatoatilio, sacarde, sinclair, stephans, TheraHedwig, tienhung, wolfi323, Yahoo [Bot]