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.

Is there a way to use hotkeys to focus on a window not determined by its program name?

Let's say there are nine program tabs open: Terminal, Eclipse and seven Chrome Windows.

Currently, I am just clicking with the mouse in the lower desktop section to change focus. What I would like to do is use keys like Super+0, Super+1, Super+2 and so on change focus.

I know there is Alt-Tab and also Super-W, which are convenient but not quite what I am looking for.

This is on 10.04, but would consider switching to 12.04 if it can do it.

share|improve this question
add comment

1 Answer

There is a handy utility in the debian repos called wmctrl:

sudo apt-get wmctrl

You can use wmctrl to give a window of your choice focus by title so your button shortcuts would be something like: wmctrl -a 'user@dev'

If you consult the info for wmctrl you'll find more sophisticated options that should make scripting to get the first chrome window or some such accessible but at that point you are probably better off using Super-W anyway.

I find this very handy if you are a fan of emacs org-mode. I put capture onto the pause key and give focus to the emacs buffer using wmctrl so that I can make quick notes on phone calls or tasks that pop up without interfering with my work flow.

share|improve this answer
add comment

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.