Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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)?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer

I've written a small program called jumpapp for exactly this purpose. It lets you create one keyboard shortcut to opens a new terminal the first time you press it, and to switch to the already open window any time you press it after that. As a bonus, if you have multiple terminal windows open, repeatedly pressing the shortcut will cycle through all the terminal windows.

enter image description here

It's easy to install from source, or you can install it from my PPA:

sudo add-apt-repository ppa:mkropat/ppa
sudo apt-get update
sudo apt-get install jumpapp
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.