Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Your Answer


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.