How to make single instance program which no built-in setting to make it?

I use rofi to run a program or activate a window.
But I get a program most of the time lay on tray no window shows. Every time I want to open the window of it, there is only one choice “run this app”. So I get two of it.
So is there a way to make it single instance? When it already run, I start the program again, it show the window instead of run the second program?

Welcome to Manjaro! :smiling_face_with_three_hearts:

  1. Please read the information behind this link. It will help you to post necessary information.
  1. Please press the three dots below your post and then press the :pencil2:
  • If you give us information about your system, we can see what we’re talking about and make better suggestions.
  • You can do this by using inxi in a terminal or in console.
sudo inxi --verbosity=8 --filter --width 
  • Personally identifiable information such as serial numbers and MAC addresses are filtered out by this command
  • Presenting the information in this way allows everyone to be familiar with the format and quickly find the items they need without missing anything.
  1. Copy the output from inxi (including the command) and paste it into your post.
  • To make it more readable, add 3 backticks ``` on an extra line before and after the pasted text.

Have you already :mag: for your problem in the forum ? (Wisdom lies in asking → listening → reading :wink: )