Commit b8dcad01 authored by Marco Martin's avatar Marco Martin
Browse files

replace the systemloadviewer plasmoid with new systemmonitor

add a migration script that looks for instances of the old
systemloadviewer and replaces with 3 separate instances of
systemmonitor probing cpu, memory and swap respectively
parent 35b95abb
function swapWidget(desktop, oldWidget, newType, geometry) {
desktop.addWidget(newType, geometry.x, geometry.y, geometry.width, geometry.height);
for (var i in desktops()) {
var desktop = desktops()[i];
for (var j in desktop.widgetIds) {
var widget = desktop.widgetById(desktop.widgetIds[j]);
let newType = ""
if (widget.type == "org.kde.plasma.systemloadviewer") {
let geometry = widget.geometry;
geometry.width = geometry.width/3
desktop.addWidget("org.kde.ksysguard.sensorchart.cpuusage", geometry.x, geometry.y, geometry.width, geometry.height);
geometry.x += geometry.width;
desktop.addWidget("org.kde.ksysguard.sensorchart.memoryusage", geometry.x, geometry.y, geometry.width, geometry.height);
geometry.x += geometry.width;
let swapWidget = desktop.addWidget("org.kde.ksysguard.sensorchart", geometry.x, geometry.y, geometry.width, geometry.height);
swapWidget.currentConfigGroup = ["Appearance"];
swapWidget.writeConfig("title", "Swap");
swapWidget.currentConfigGroup = ["Sensors"];
swapWidget.writeConfig("highPrioritySensorIds", "[\"mem/swap/used\",\"mem/swap/free\"]");
swapWidget.writeConfig("totalSensors", "[\"mem/swap/used\"]");
swapWidget.currentConfigGroup = ["SensorColors"];
swapWidget.writeConfig("mem/swap/free", "230,230,230");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment