24

When using task switching in the default graphical mode of Ubuntu 12.04, if they are multiple windows of the same kind, eg. multiple Terminal windows, you can see them all together and select which one you want.

enter image description here

My problem is that the order of these windows is constantly changed. It follows the "last used" order. I want them in a fix order always; how can I do it?

n611x007
  • 565

3 Answers3

2

Rather than changing the unity codebase, you might consider using desktops to arrive at your desired result.

Example using Compiz Desktop Cube in CompizConfigSettingsManager

Open CompizConfigSettingsManager (ccsm) and change settings to match the following:

ccsm-1

ccsm-2

Open terminal 1

Use the keyboard shortcut CTRL-ALT--> (right arrow) to go to the next desktop to the right.

Open terminal 2

Use the keyboard shortcut CTRL-ALT--> (right arrow) to go to the next desktop to the right again.

Open terminal 3

Use the keyboard shortcut CTRL-ALT-<- (left arrow) to go to the previous desktop containing terminal 2 (or twice to get back to terminal 1)

Another Option

Use the Viewport manager in CompizConfig SettingManager and assign a key combination to go directly to the desktop of your choices

Note: Thus far I've only been able to get 10 to work although 12 should be possible with this method. ccsm-3

Update: based on concerns expressed in comments:

Simply Right Click on gedit title bar and choose always on visible workspace...

Another Option:

Rather than opening seperate terminals (or workspaces) for your numerous activities you can also use tabs in gnome terminal. Shortcut keys for tab switching are available from terminal preferences. See below:

terminal-prefs

Elder Geek
  • 36,752
1

Another option, if your desktop is large enough, is to set some windows to "always on top" and arrange them around so that you can switch using the mouse. It's a kludge... but I sometimes find it useful when working with multiple windows of the same type.

Yet another is to define several terminal profiles with different color schemes and use a different one for each terminal... it would make them easy to identify.enter image description here Yeah, this one is a workaround too.

1

I think that you can achieve this by modifying the source code of Unity 7. Just follow the steps described on the developer site but before starting the building process open: ./trunk/plugins/unityshell/src/unityshell.cpp and take a look at SetUpAndShowSwitcher function:

void UnityScreen::SetUpAndShowSwitcher(switcher::ShowMode show_mode)
{
  RaiseInputWindows();

  if (!optionGetAltTabBiasViewport())
  {
    if (show_mode == switcher::ShowMode::CURRENT_VIEWPORT)
      show_mode = switcher::ShowMode::ALL;
    else
      show_mode = switcher::ShowMode::CURRENT_VIEWPORT;
  }

  auto results = launcher_controller_->GetAltTabIcons(show_mode == switcher::ShowMode::CURRENT_VIEWPORT,
                                                      switcher_controller_->show_desktop_disabled());

  if (switcher_controller_->CanShowSwitcher(results))
    switcher_controller_->Show(show_mode, switcher::SortMode::FOCUS_ORDER, results);
}

Here you can clearly see that this is exactly the function what we were looking for. The upper part is responsible for the switching of the viewport modes:

Show modes

This toggling appears each time we move into a group of Apps or if we move out of the group. optionGetAltTabBiasViewport indicates when this happens. Then GetAltTabIcons is involved in order to get the right icons. And finally the Show function with the SortMode::FOCUS_ORDER is called to display our sorted icons. SortMode is an enum:

enum class SortMode
{
  LAUNCHER_ORDER,
  FOCUS_ORDER,
};

and changing FOCUS_ORDER to LAUNCHER_ORDER should solve your problem. You could insert an additional if statement before calling Show to prevent launcher order sorting in ShowMode::ALL case.

Please note that the source code of Unity 8 looks completely different. So this solution may work for Unity 7 only. After half an hour fixing missing dependencies and after another hour fighting with cmake I decided not to ruin my system and try it out in VM tomorrow ;)