I'm looking for a way to run commands in a widget I'm trying to develop.

So far I've come across the org.kde.kio.KRun, which should be an interface to the kRunner. From the few examples I have seen, I only found that KRun has the following methods: openUrl, openService (which are not useful for running commands). I've tryed googling about it, but the only resource I've found is this one which seems to be very different from the org.kde.kio.KRun used in the widgets.

How can I run a command from a widget?


If your widget is using the C++ then you could write a C++ plugin to handle the execution of the commands: Run system commands from QML App

If your widget is a QML only then you could use the PlasmaCore. An example plasma widget: https://store.kde.org/p/1166510/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.