Raise window if the application is active with qvm-run

I would like to have the possibility of choosing on a per application basis to raise the window (if it’s already running) instead of creating new instances.

Default behavior:
qvm-run QUBE-NAME APPLICATION-NAME = run application
What I want:
qvm-run QUBE-NAME APPLICATION-NAME= if running: raise window else: run application

What should it do if the application is running…on a different desktop (or activity, if it’s KDE)?

Sorry, I have misinterpreted the default behavior of qvm-run based on the strange behavior of some applications. qvm-run does in fact create new instances of the same application. I have edited the topic to clarify this.

This is not happening for GNU/Linux in general, only for applications that do this themself.

You should write your own script inside the qube that will do that (presumably in bash).
And execute it instead of your application.