Keyboard shortcut to switch to an application by name?

Is there a tool that will let me do the following sequence?

  1. Type a keyboard shortcut
  2. Type in the name of an application currently open on some desktop
  3. Hit Enter to switch to that desktop, and bring that application into focus instantly

(The Chromium plugin Vimium provides an analogous feature for browser tabs: pressing Shift-T in that environment to list all tabs, type in some words to filter by title, and hit enter to bring up the selected tab.)


In the same System Settings window that Mechanical snail mentions, you can configure a new Custom Shortcut (two places up the tree from Global Shortcuts). Make it of type Command/URL with the following action:

xdotool windowactivate `xdotool search --name Vimperator | head -1`

Of course, change Vimperator to the name of the desired application.


If you use KDE, you can do this using KRunner (KDE's run dialog/toolbar). KRunner provides functionality to search the titles of running windows; you just need to add a global keyboard shortcut to activate it.

Setup

Open systemsettings and browse to "Global Keyboard Shortcuts". In the "KDE component" dropdown, select "Run Command Interface" to look at the shortcuts for KRunner. Scroll to "Run Command (runner "Windows" only)", click on it, and specify a keystroke to use (I have Win-W):

Set keystroke

Click Apply and close System Settings.

Usage

Press the shortcut you chose to bring up KRunner. Start typing the title of a window. Once you've narrowed it down to the window you want, press Enter to switch to its virtual desktop and focus the window. You can also click on the window in the drop-down list:

Window run dialog


Found nasty solution for kde5.

If you want to have full list of windows with search by titles:

  1. Go to System Settings -> Workspace -> Shortcuts -> Custom Shortcuts

  2. Create new Global shortcut -> Command/URL (by right click)

  3. Tick the checkbox to the right of the name

  4. In Trigger tab select desired key combination

  5. In Action tab type /usr/local/bin/krunner-search-by-windows.sh

  6. Create file /usr/local/bin/krunner-search-by-windows.sh with following content:
    #!/bin/bash qdbus org.kde.krunner /App querySingleRunner windows "" sleep 0.4 xdotool type 'window ' xdotool key "shift+BackSpace"

  7. Make file executable and give run permission to all
    chmod a+x /usr/local/bin/krunner-search-by-windows.sh

Note the space after 'window'.

Now you're able to get list of opened windows by specified shortcut and search by this list as you type;


If you only want search by titles without full windows list:

  1. Go to System Settings -> Workspace -> Shortcuts -> Custom Shortcuts

  2. Create new Global shortcut -> D-bus Command (by right click)

  3. Tick the checkbox to the right of the name

  4. In Trigger tab select desired key combination

  5. In Action tab insert following information:

    • Remote application : org.kde.krunner
    • Remote Object : /App
    • Function : querySingleRunner
    • Arguments : windows ""
  6. Done