Enforcing only one instance of an app is launched from a panel

Hi KDE. I posted this question on r/kde and the bot directed me to use this forum instead. Could someone please advise?

On X11, you can run a script that looks at the current list of windows from wmctrl -l and work out if the app is already running and switch to it if it is, again using wmctrl.

With Wayland, someone originally decided that I shouldn’t allowed to do that sort of thing. %^$%$%$! My best hope now is that kwin will provide the functionality, perhaps via the dbus.

I use the wmctrl approach to work with several konsole processes. They’re all called konsole.konsole, but the script can grep /proc/<pid>/environ to find the right one.

That’s some great advise there. I’ll look into it. Thanks!

are you saying you only want to see one icon in the task manager no matter how many of those windows are open?

or are you saying you one want to have one window of that program open at time no matter how many times you click on the icon?