Possible to have press of touch bar dock icon hide the app if it's already open?

I'd really love it if pressing on the app in the touch bar "dock" section opened/"brought to front" the app if it wasn't open or was hidden, and would hide the app if it was already open and not hidden.

Is there a way to do that?