Requirements
- Linux, Mac has a nifty tool for this, which inspired this script
- X11 (X Window System),
wmctrldoesn't work with Wayland awkfor text processingwmctrlfor manipulating windows
You should be able to get awk and wmctrl in your package manager of choice.
You can clone the gist by this command
git clone https://gist.github.com/1b02b9ad6a778caab260ddd3cfd1759e.git
After you place the script into a folder that is in $PATH, you need to make it executable with
chmod a+x show_app.sh
After this, you can use your desktop environment to bind a shortcut to this script with the needed parameters.
In case of Alacritty, a really fast terminal that I use, it boils down to
/home/edwin/bin/switch_to.sh Alacritty alacritty