Sunday, April 28, 2024
9
rated 0 times [  9] [ 0]  / answers: 1 / hits: 9071  / 2 Years ago, fri, february 18, 2022, 4:49:59

I am using shortcut Ctrl+Alt+T for opening a new Terminal window. I am using one of the terminal very often (calculator and simple commands) and I want to set up another shortcut (like Ctrl+Alt+R or any other, I don't care) to switch to this specific terminal window (using gnome-terminal in Unity, Ubuntu 12.04).



Is this possible (and how)?


More From » command-line

 Answers
6

There is an application called wmctrl, which can help you. You can install wmctrl by command:



# apt-get install wmctrl


You can get list of currently existing windows by wmctrl -l and see titles and names of currently existing windows. Using titles, you can raise a window by:



$ wmctrl -a <string>


To automatize this procedure, you can start specific gnome-terminal with --title parameter to set its window title. Assuming you've run:



$ gnome-terminal --title=testing


You can run:



$ wmctrl -a "testing"


to raise that window, beware of that the string you used to select window should be specific to that window, shouldn't match with any other window's title.


[#39147] Sunday, February 20, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
brasiplacar

Total Points: 314
Total Questions: 124
Total Answers: 97

Location: Dominican Republic
Member since Wed, Mar 17, 2021
3 Years ago
;