This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Basic(?) Plasmoid question: Launching application on click?

Tags: None
(comma "," separated)
Registered Member
I've been fumbling my way through creating my own Launcher widget with zero existing QML knowledge, and have got it near enough finished. It's just a list of text objects with onClicked: triggers on each. Although, of all things, I seem to be having the most trouble with actually making it launch things.
I have a single button per app, I don't intend on adding a configuration menu or anything. I just want each button to start its own app. I've tried KRun.openUrl but it can't launch .desktop files, and haven't been able to find any alternatives past that.

Any easy way to just launch an app off an onClicked: trigger?

A segment of code for one button, if it's needed:
Code: Select all
            Text {
                text: "Terminal"
                color: "white"
                font.pointSize: 21
                Layout.fillWidth: true
                horizontalAlignment: Text.AlignRight

                MouseArea {
                    anchors.fill: parent
                    onClicked: {(kRun.openUrl:"file:///usr/share/applications/org.kde.konsole.desktop")} //Refuses to run
                    hoverEnabled: true
                    onEntered: {parent.font.bold = true}
                    onExited: {parent.font.bold = false}

edit: Found and tried Qt.openUrlExternally, opens folders fine but irritatingly won't execute .desktop files for security apparently...


Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]