SUMMARY KWin Scripts lack an API to run arbitrary commands/applications. I did a simple search and found at least 4 people in reddit had asked the same question and did not find out a way to do so. I see there was a way to call dbus service `org.kde.klauncher5` to execute commands. But this service is unavailable in my system. And as this post https://bugs.kde.org/show_bug.cgi?id=455515 says, it was deprecated and removed. SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Plasma Version: 5.27.7 KDE Frameworks Version: 5.109.0 Qt Version: 5.15.0 ADDITIONAL INFORMATION
FWIW, I recently also ran into this and as a workaround wrote my own small helper program to run arbitrary commands via DBus. https://github.com/DvdGiessen/dbus-app-launcher Another (hacky) workaround to do this (without an additional dependency) is adding an DBus autostart file for the command you want to run, which will let the DBus deamon start your app for you. But I agree having this functionality be available directly in the scripting API would be much better.