on my laptop 1=ASUS vivobook pro N552VW-FY204T (2016) with freshly installed leap 16.0 running KDE 6.4.2
I would like to port my (very simple) plasmoids from plasma5 to plasma6, many time ago one of you helped me to write plasmoid that show the standard out result of a command.
I tried something and get something that doesn’t give errors but I cannot get the result
this is the code of the plsma5 plasmoid:
import QtQuick 2.2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
Rectangle {
radius: 20
opacity: 0.5
width: 500
height: 80
id: mainitem
property string userName
PlasmaComponents.Label {
text: i18n(userName)
font.pointSize : 30
color: "red"
}
PlasmaCore.DataSource {
id: whoamisource
engine: "executable"
connectedSources: ["hostname"]
onNewData:{
mainitem.userName = qsTr("host= ") + data.stdout
}
}
}
this is the plasma6 plasmoid that gives no error and no result:
import QtQuick
import org.kde.plasma.plasmoid
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PlasmaComponents
import org.kde.plasma.plasma5support as Plasma5Support
PlasmoidItem {
id: root
Plasma5Support.DataSource {
id: executableSource
engine: "executable"
connectedSources: ["whoami"]
onNewData: {
mainitem.userName = ["stdout"]
}
}
// Full representation (when on desktop)
fullRepresentation: PlasmaComponents.Label {
text: i18n(userName)
font.pixelSize: 40
color: "red"
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
}
}
could somebody help me to have the same result of plasma5 plasmoid with plasma6 plasmoid?