Option 1: keybinding to activate pinned icon
One way that will work on any standard Ubuntu desktop, whether it runs on Xorg or Wayland, is to bind an extra key to the build in functionality to switch to a pinned icon on the dash. By default, Super+1 activates, or starts if it is not yet running, the application pinned first.
Suppose your terminal is pinned as the fourth icon on the dock. By default, you can switch to it hitting Super+4. To also switch to it using Control+Alt+T, first deactivate the default binding ("Settings", "Keyboard", "Keyboard shortcuts", "Launch terminal" under "Launchers"). Then either use dconf-editor to add a key, or use the terminal:
gsettings set org.gnome.shell.keybindings switch-to-application-4 "['<Super>4','<Control><Alt>t']"
Option 2: Using the Gnome Shell extension Run or raise
Run or raise can be configured with much more control, and independent on the order of the icons in the dash, using the very well maintained Gnome Shell extension Run or raise by e2rd.
For users of default Gnome Shell: it allows also to bring a single window to the front, whereas the previous option will behave as if you clicked the icon on the dash, i.e., bring all windows of the application in front.
Option 3 (Xorg only)
For systems running on Xorg, the classical Xorg tools continue to do their excellent job. Delete the default keybinding to launch the terminal (see above) and create your custom version, assigning the command:
sh -c "wmctrl -x -a Gnome-terminal || gnome-terminal"
First part checks if a window of class "Gnome-terminal" exists and activates it. If that fails (||
) the second command is attempted, i.e, launching the terminal.
For the same but on steroids, you can use the excellent bash script jumpapp instead. It uses wmctrl
under the hood, but allows to cycle between different open windows by repeatedly hitting the shortcut key, workaround situations where the window is closed, but a background process remains running for some time, etc. (I am looking at you, nautilus...)
As elaborated in Natan's answer, also xdotool
can be used. Also that option is only working on Xorg.