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

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 2 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
    
This looks awesome but for me it says there is no package available. I'm running Ubuntu 12.04 –  Klik Mar 19 at 18:32
    
You'll have to install from source (don't worry -- it's not too complicated). I don't think Ubuntu will let me upload a package to my PPA for 12.04 anymore. –  Michael Kropat Mar 19 at 19:20

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.