Bash command to focus a specific window
Problem
Is there a way, in bash command line, to give focus to a specific window of a running process. Assume I know the process' name, number, and anything else I need. For instance, if I have a single instance of Firefox running, but it's minimized (or there's some other window on top of it). I need a bash command that brings up and gives focus to the Firefox window, by making it the active window.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: Bash command to focus a specific window
The wmctrl command seems to do the job. It was already installed for me, but it's available in the repositories in case anyone needs it. Lists currently open windows (including the gnome panels). Gives focus to a window containing STRING in its title. I'm not sure what happens if more than one window meets that condition. In my case the command was:
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix