Kde widget doubt

I am trying to make a custum animated “start” orb which involved gifs everything mostly works as expected, but clicking it brings up no “start menu“.

I just want it to execute a command when left clicked.

Contents of the main.qml file:

import QtQuick
import org.kde.plasma.plasmoid

PlasmoidItem {
    id: root
    implicitWidth: 32
    implicitHeight: 32

    property bool hovered: false

    Image {
        anchors.fill: parent
        source: "orb_static.png"
        visible: !root.hovered
        fillMode: Image.PreserveAspectFit
        smooth: true
    }

    AnimatedImage {
        anchors.fill: parent
        source: "orb_hover.gif"
        visible: root.hovered
        playing: root.hovered
        fillMode: Image.PreserveAspectFit
        smooth: true
        onVisibleChanged: if (visible) currentFrame = 0
    }

    MouseArea {
        anchors.fill: parent
        hoverEnabled: true
        acceptedButtons: Qt.LeftButton

        onEntered: root.hovered = true
        onExited: root.hovered = false

        onClicked: {
            plasmoid.action("open").trigger()
        }
    }
}

all i want the orb to do on left mouse click is to execute this command:
qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.activateLauncherMenu

I am very new to this, it would be appreciated if someone could throw in advice for making custom app launcher menu…

I am running KDE Plasma on fedora everything is updated and i am using Wayland.

You might be able to use components/dbus: add DBusMethodCall (!4231) · Merge requests · Plasma / Plasma Workspace · GitLab from QML instead of a command line.

import org.kde.plasma.workspace.dbus as DBus

const msg = {service: "org.kde.plasmashell", path: "/Plasmashell", iface: "org.kde.PlasmaShell", member: "activateLauncherMenu", arguments: {}} as DBus.dbusMessage
const asyncReply = DBus.SessionBus.asyncCall(msg)
asyncReply.finished.connect(() => {
    // do something
    asyncReply.destroy()
})

yeah this goes way over my head man…maybe i took on more than i can chew, maybe i should come back to this after few more months of practice…ill still try it though when i get some time

oo shii thx my man it worked

1 Like