1

What I miss from DockBarX is the possibility of adding keyboard shortcuts for switching to the next/previous windows in the group of windows for an application, and the next/previous applications.

Is there a way I could have this with Unity? Perhaps Unity already offers such features that I do not know about? normal behavior?

Also, I would like to preempt the suggestion that I simply shorten the default width of windows to accommodate the for the launcher. Firstly, this defeats the purpose of having purchased a monitor this wide in the first place; 1024 pixels is an important minimum width to meet because many popular websites are de

3 Answers 3

1

I wrote my own script:

Notes: call it with python script.py next OR python script.py prev FROM a Compiz custom command OR Gnome custom keyboard shortcut.

#!/usr/bin/env python
# by desgua
# version 0.1.3 - May 06 2011
# To minimize with unity Launcher
# Modified for next/previous active windows by Andrei Canciu <[email protected]>
##################################
import os
import wnck
import gtk 
import sys 
screen = wnck.screen_get_default()

if not (len(sys.argv) >= 2): 
  sys.exit()

command = sys.argv[1]

while gtk.events_pending():
    gtk.main_iteration()

windows = screen.get_windows()
active_app = screen.get_active_window().get_application()
active_window = screen.get_active_window()
active_windows = []
previous_window = None
next_window = None

if (len(windows) == 0) or (not active_app) or (not active_window):
  sys.exit()
for w in windows:
    if w.get_application() == active_app:
        active_windows.append(w)

if len(active_windows) == 0:
  sys.exit()

for i in range(0, len(active_windows)):
  current_window = active_windows[i]
  if current_window == active_window:
    previous_window = active_windows[i-1]
    if i+1 >= len(active_windows):
      next_window = active_windows[0]
    else:
      next_window = active_windows[i+1]

    break

if (not next_window) or (not previous_window):
  sys.exit()

if command == 'next':
  next_window.activate(1)
else:
  previous_window.activate(1)
1
  • Actually the above script is an exercise in futility. There are plugins in Compiz (CCSM) including the default "Static Application Switcher" that have the possibility to switch between windows in a group. The above script can still be used as a base for some more complicated processing.
    – user12681
    May 23, 2011 at 3:23
0

It's easy just press Alt+Ctrl+TAB

2
  • Apparently, Alt+Ctrl+TAB is the same as Alt+Tab only that all the windows of all the apps are laid down there. This is not what I want though. In DockBarX, I could have a shortcut that would only switch among the windows of a single app. I guess a custom script can always be written - I just hoped there was an easier way to do it.
    – user12681
    May 18, 2011 at 22:03
  • Actually, it's exactly the same as Ctrl+TAB. Perhaps this is not working in Ubuntu/Unity. Anyway, I just wrote my own script, see below.
    – user12681
    May 21, 2011 at 4:47
0

Alt+` switches among the windows of the current application (e.g. Chrome windows), and Alt+Tab switches among groups of windows.

You must log in to answer this question.