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 any way to use some of the function keys on the keyboard for switching to an application? For example, I want to use F5 key to switch to Google Chrome and F6 key to Firefox etc.

Just to be clear: I don't want to launch an application using those keys. I want to bring the already running application to the front (I don't care if they launch the application if they aren't already running. It's a plus, however not necessary).

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Activities - Keyboard - Shortcuts - Custom Shortcuts.

Define a shortcut and assign a shortcut key. When you press that key, application will launch or will come to foreground - if already running.

share|improve this answer
    
Thanks. I have tried this for Chromium - Emacs - Firefox, however the keys launch a new instance instead of switching to them. I am looking for a solution which works for at least these 3 programs. –  loudandclear Dec 9 '11 at 8:50
    
I found out that wmctrl is the tool to do that. Binding wmctrl -a <window-title to the function keys using the Custom Shortcuts section that you mentioned works as intended. Does not launch a new instance if a window matching that title isn't available, however that's ok. –  loudandclear Dec 10 '11 at 9:56
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.