Bug 474207 - Provide a scripting API to run arbitrary commands
Summary: Provide a scripting API to run arbitrary commands
Status: CONFIRMED
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (show other bugs)
Version: 5.27.7
Platform: Arch Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-06 05:33 UTC by coherence
Modified: 2024-05-18 22:55 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description coherence 2023-09-06 05:33:01 UTC
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
Comment 1 Daniël 2024-04-06 17:33:23 UTC
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.