I'm running Emacs in a GUI, and I like having a keybinding that quickly switches me to a terminal. Yes, I know there's eshell, term, and shell in Emacs, but I still prefer a dedicated terminal emulator for a lot of my work.
When I'm on macOs, I use a function that switches application focus to iTerm,
(defun os-switch-to-term () (interactive) (when (display-graphic-p) (do-applescript "tell application \"iTerm\" to activate")))
I'm pretty sure I lifted this from doom-emacs. I'm now spending most of my time in Linux, so I'm searching for a way to translate the above functionality to something that will work in a different desktop environment (I'm currently using Gnome on Ubuntu, and gnome-terminal, though I'm still hunting for a terminal emulator I like better).
I imagine the options will depend on the flavor of Linux, and which window manager and/or desktop manager you're using, but as a start, how might I translate this to a Gnome environment w/gnome-terminal?