I found this thread and implemented it, sharing my version.
I created a executable file /usr/local/bin/run_once.sh containing
#! /bin/bash
application=$1
if wmctrl -xl | grep "${application}" > /dev/null ; then
# Already running, raising to front
wmctrl -x -R "$application"
else
# Not running: starting
$@
fi
This checks using wmctrl if the application you are trying to start already has a window open (some gui programs keep workers without a gui running) instead of using ps, using -x to use the WM_CLASS instead of the title-bar name.
For each program that I only want one window of I copied the system .desktop file to ~/.local/share/applications and changed the exec field from exec=program --arguments to exec=/usr/local/bin/run_once.sh program --arguments