Friday, September 29, 2023
rated 0 times [  7] [ 0]  / answers: 1 / hits: 4120  / 8 Months ago, sat, february 11, 2023, 8:49:34

I'm using Ubuntu 10.10 and I always have opened windows:

Browser, console, vim and Skype. I want to set specific shortcut-keys for those windows. Is there a way to use for example:

Win-C = Google Chrome
Win-T = terminal
Win-S = Skype

I want use hotkeys to switch between these windows.

More From » shortcut-keys


It is possible to achieve this with a python script. The script requires python-wnck and python-gtk to be installed in order to work, although I think these are installed by default anyway.

Copy and paste this into a text editor and save in a sensible place (eg. in your home folder):

#!/usr/bin/env python2
import wnck
import gtk
import sys
import time

screen = wnck.screen_get_default()

while gtk.events_pending():

windows = screen.get_windows()

for w in windows:
if len(sys.argv) > 1:
if w.get_application().get_name() == sys.argv[1]:
print("Application name of window with title " + repr(w.get_name()) + " is " + repr(w.get_application().get_name()))

You can then set up the keyboard shortcut by opening Keyboard Shortcuts (System->Preferences->Keyboard Shortcuts).

Click add to create a new shortcut.

enter image description here

Use the command bash -c 'python ~/ Terminal' (this is assuming you saved it as in your home folder). Replace 'Terminal' with the application name of the window you want to switch to. To find out the application names of the currently opened windows, run python ~/ in a terminal.

enter image description here

You can then assign your preferred keyboard combination to this action.

[#44541] Sunday, February 12, 2023, 8 Months  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 354
Total Questions: 112
Total Answers: 100

Location: Guam
Member since Fri, Jun 18, 2021
2 Years ago
listeerrated questions
Wed, Jun 8, 22, 11:43, 1 Year ago
Wed, Mar 23, 22, 03:25, 2 Years ago
Wed, Jun 2, 21, 20:28, 2 Years ago