Left-click on plasmoid in system tray fails to execute command
Unsolved
QML and Qt Quick
-
Hello and thanks for the help.
If this forum is not for beginners, please point me to a beginners forum. (I'm learning plasmoids and QML.)I'm trying to create a plasmoid that executes a command when the user left-clicks on its system tray icon.
Unfortunately, I get an error message when I left-click on the plasmoids system tray icon."main.qml":
import QtQuick 2.5 import QtQuick.Extras 1.4 import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.core 2.0 as PlasmaCore Item { id: root // If the plasmoid in the system tray is left-clicked, then execute a system command. Plasmoid.icon: plasmoid.configuration.icon Plasmoid.icon.onClicked: { systemCommand.exec('konsole --noclose -e "echo \"Hello world\""') } // Execute a system command. PlasmaCore.DataSource { id: systemCommand engine: "executable" connectedSources: [] onNewData: { exited(sourceName) disconnectSource(sourceName) // cmd finished } function exec(cmd) { connectSource(cmd) } signal exited(string sourceName) } }
Error message:
Error loading QML file: file:///home/test/.local/share/plasma/plasmoids/test/contents/ui/main.qml:11:19: Cannot assign a value directly to a grouped property
I've misconfigured "Plasmoid.icon.onClicked", but I don't understand what I've done wrong (still learning object programming).
I'd appreciate any pointers on what I've done wrong.
Thanks for the help.