How to prevent Gnome-shell's Alt+Tab from grouping windows from similar apps?

261

85

I love pretty much everything about how Gnome Shell handles app-switching through Alt+Tab. My one gripe with it, though, is how it forces the user to use Alt+` (or Alt+ whatever key above the Tab key for non-US keyboard layouts) to switch between windows of the same app. This is very annoying for me, because now I have to keep in mind if the last window I was using belonged to the same app as the current window or not. Definitely a nuisance for power users who thinks in terms of "windows I'm working with" instead of "applications I'm working on".

I've tried the AlternateTab extension ( https://extensions.gnome.org/extension/15/alternatetab/ ), but it's looks way too ugly for me. Not to mention that in the end all I want is to remap Alt+(key above tab) to Alt+Tab on this application. I guess one option would be to just tweak Gnome-shell. My guess is that I should tinker with the altTab.js file at /usr/share/gnome-shell/js/ui/, but the file is too long and overwhelming for someone like me, who doesn't know JavaScript.

Does anyone know how I can make Gnome Shell stop grouping windows by applications?

Waldir Leoncio

Posted 2012-02-27T01:55:15.547

Reputation: 3 158

1@mimoralea, glad I could help. Too bad the shell is not intuitive enough. – Waldir Leoncio – 2015-04-27T17:56:34.123

1See answer below from @dogmatic69 . Best answer to your question imho. – Louis Parkin – 2017-06-19T10:13:30.073

@Hitsugaya198, I agree that installing that Shell extension is currently the best path. – Waldir Leoncio – 2017-06-19T11:21:37.617

@Kugel or anyone really - how to press this combo on non-US keyboards where ` requires shift? – Nearoo – 2018-10-15T09:24:56.863

@Nearoo, IIRC it shouldn't matter what keyboard configuration you have, you should press whatever you have above "Tab" instead of "`". – Waldir Leoncio – 2018-10-16T12:10:46.563

@WaldirLeoncio Yup, works, thanks. Didn't think of that. – Nearoo – 2018-10-16T15:49:20.770

33Thanks for the Alt + `. I've been google for this for a while now. – Kugel – 2012-10-30T22:48:45.780

Answers

304

  • Open dconf-editor
  • Go to org/gnome/desktop/wm/keybindings
  • Move the value '<Alt>Tab' from switch-applications to switch-windows
  • Optionally move '<Shift><Alt>Tab' from switch-applications-backward to switch-windows-backward
  • If you want switch-windows to work across desktops, not just in the current desktop, you can also uncheck org/gnome/shell/window-switcher/current-workspace-only (Courtesy of @CharlBotha)
  • Close dconf-editor
  • If using X11, press <Alt>F2, then type r to restart Gnome.

The last step does not always appear to be necessary, but it should not hurt (especially since it does not close any of your running applications). It will not work, and is not necessary for Wayland.

Mad Physicist

Posted 2012-02-27T01:55:15.547

Reputation: 3 270

28I'm surprised that people are so readily installing third-party application switchers in favour of reconfiguring Gnome in place. This to me is a much more desirable solution than most others presented. – mirichan – 2015-08-11T00:50:34.887

Presumably the good extensions are just a script to automate this process. I certainly agree with you that configuration is the optimal solution when possible. – Mad Physicist – 2015-08-12T14:29:21.263

14Awesome and +1 more for Alt+F2-->r for restarting gnome – Anand Rockzz – 2016-11-06T03:17:17.900

@JacobGoulden. There is never a wrong time to change the accepted answer. You should tell that to the OP. – Mad Physicist – 2016-12-01T19:42:30.147

This answer looked really promising, but unfortunately for Ubuntu (16) users, compiz or something seems to override Gnome and this doesn't work. Too bad... – mivk – 2017-01-10T13:33:26.370

Had a special case where pestophagous' answer didn't help, but yours did. In my case, switch-applications had both '<Alt>Tab' and '<Super>Tab' assigned to it, while switch-windows had just assigned '<Alt>Tab' to it. Obviously the setting for switch-applications "won" and thus I couldn't switch windows anymore. The Gnome control center dialog did not display the mapping correctly but dconf-editor did. I migrated from Ubuntu's gnome-flashback to Gnome 3. Maybe that caused the artifact. – dasup – 2017-02-28T21:16:49.413

11To have the switch-windows work across workspaces, uncheck org.gnome.shell.window-switcher.current-workspace-only using dconf-editor. – Charl Botha – 2017-04-18T07:02:14.987

1On Ubuntu 17.10 I had to apt install dconf-editor first, not sure if it's included in other distros. – Kim Gräsman – 2017-10-26T20:01:32.983

3It worked on Ubuntu 18.04! – qmn1711 – 2018-06-14T13:05:59.580

this saved me from having to use the arrow keys in switching windows. thx – semiomant – 2018-10-09T11:43:28.690

4I just did that config change via the normal Gnome Settings App, under Keyboard. Find "Switch Windows", assign it "Alt+Tab" and then "Switch Apps" is automatically unassigned. No need to edit config files! – Robert Jack Will – 2018-11-15T11:37:28.607

@qmn1711 I think you had it already installed, because I had to install dconf-editor on 18.04.1 – Eric Fossum – 2019-01-16T18:23:08.853

1Just an addendum, Alt+F2 -> r doesn't work in Wayland. – ptkato – 2019-04-13T17:28:56.633

@ptkato. Doesn't work and isn't necessary. Thanks for the reminder. – Mad Physicist – 2019-05-07T03:07:58.567

1I want to thank the community here. Virtually my entire reputation on this site comes from this one answer. I honestly have no idea why it is so popular. – Mad Physicist – 2019-05-10T21:27:12.600

For extra laziness https://superuser.com/a/1517491/384307

– Hendry – 2020-02-06T10:31:16.590

125

From the comment by 'xaeth' on this Ergo Project blog post, I have learned that Alt+Esc will cycle through all windows without grouping by application. This was the simplest solution for me, and I'm glad it saved me from having to install other programs.

If testing with Alt+Esc turns out favorably for you, then you can go to System Settings > Keyboard > Shortcuts > Navigation and reassign Alt+Tab to perform the navigation task that was previously assigned to Alt+Esc. In my settings this task is named 'Switch windows directly'.

pestophagous

Posted 2012-02-27T01:55:15.547

Reputation: 1 359

4It doesn't give the same behavior. The expected behavior is to quick jump to the needed window. This is kind of a scroll jump, meaning you scroll over each windows, need to visually process each view until you stop at the desired one. – AlikElzin-kilaka – 2014-11-22T04:53:46.203

3Does not unstack the windows for me, nor allow me to cycle through windows. It still cycles through applications. Maybe I should login again? Weird. – Lodewijk – 2015-02-16T07:01:58.573

1

@Manu thanks. i just replaced the link with its 'wayback machine' equivalent. https://web.archive.org/web/20130117005937/http://planet.ergo-project.org/blog/jmeeuwen/2012/01/31/gnome-3-alt-tab-keyboard-addicts (i just wanted to give credit to the original blogger. the link doesn't add too much info.)

– pestophagous – 2015-08-21T15:49:10.343

7Doesn't work in Ubuntu 16 – Anand Rockzz – 2016-11-06T03:16:07.447

6@Waldir Leoncio. Set Alt+Tab to "Switch windows" instead of "Switch windows directly" and the thick frame should disappear. Gnome 3.26 – bartolo-otrit – 2018-01-25T12:34:01.923

This solution doesn't show the panel displaying all open windows, most voted solution does. – Puck – 2018-05-17T06:28:25.710

Alt+Esc only does open windows. Same on Windows. – Cees Timmerman – 2020-02-27T12:37:24.093

6Thank you very much for your tip, it really works! Now if I could just figure out how to get rid of that thick black frame around the selected window and have it display that "selection box" Alt+Tab gives I'll be in heaven. :) – Waldir Leoncio – 2012-09-30T11:31:57.237

39

Little help -

Alt+Tab and then when you have grouped windows Alt+` helps a bit.

rtdp

Posted 2012-02-27T01:55:15.547

Reputation: 491

8I'm aware of that, my question is actually about assigning Alt+Tab for switching windows no matter what their relationship with the last active window. I'll update the question to make it clearer. – Waldir Leoncio – 2012-02-27T19:56:25.547

19

AlternateTab

Substitute Alt-Tab with a window based switcher that does not group by application. This extension is part of Classic Mode and is officially supported by GNOME. Please do not report bugs using the form below, use GNOME Bugzilla instead.

https://extensions.gnome.org/extension/15/alternatetab/

Walialu

Posted 2012-02-27T01:55:15.547

Reputation: 311

5+1 best answer here. Works flawlessly in Ubuntu 17.10. Thanks! Searcher for "AlternateTab" in "Acitivites" and it pops right up – gromit190 – 2017-11-06T08:25:28.540

It seems to be supported already without the need to install the extension. See post from the developer: https://blogs.gnome.org/fmuellner/2018/10/11/the-future-of-alternatetab-and-why-you-need-not-worry

– AlikElzin-kilaka – 2019-06-21T14:57:06.897

This should be accepted answer. Totally hassle free. – Lokesh – 2020-02-06T07:26:25.583

18

The Windows Alt Tab extension by tglman is very useful. You can also fork it on GitHub.

Takida

Posted 2012-02-27T01:55:15.547

Reputation: 181

Exactly what I was searching for and very simple to install – Pierre de LESPINAY – 2014-08-07T11:37:38.050

1

No need an extension, see this comment https://superuser.com/a/860001/914650. It worked on my Ubuntu 18.04

– qmn1711 – 2018-06-14T13:10:28.837

1This is the real answer to the question! – Елин Й. – 2013-03-31T21:48:06.650

13

Using fedora 23 you can do the following

Install alternate-tab (was already installed for me)

sudo dnf install gnome-shell-extension-alternate-tab

Run pref editor

gnome-shell-extension-prefs

Then enable it

enter image description here

DONE, alt tab is no longer lame. Also its not some hack like the above with changing the keyboard short cuts. Alt-tab will still show the popup with thumbnails etc, just not grouped.

EDIT:

As Ubuntu has now switched back to Gnome I found myself trying to fix this issue again. It's even simpler if you have the gnome web plugin, just visit the alternate-tab plugin and click enable and it will be instantly fixed.

alternate tab

alternate tab

dogmatic69

Posted 2012-02-27T01:55:15.547

Reputation: 232

1+1 and this should be the 'correct' answer, as it directly resolves the issue as was asked. I suspect your distro has less to do with it, and more the fact that you are using Gnome desktop, as I just utilised your solution successfully on Ubuntu 17.04 with Gnome 3 desktop. – Louis Parkin – 2017-06-19T10:11:21.580

1This is the only solution that worked for me and its so simple. – Lokesh – 2018-07-30T09:41:58.490

11

You can use the terminal to edit the preferences for the default switcher (This is a command-line equivalent of Mad Physicist's dconf-editor answer.)

run:

dconf write /org/gnome/desktop/wm/keybindings/switch-windows "['<Alt>Tab']"
dconf write /org/gnome/desktop/wm/keybindings/switch-windows-backward "['<Shift><Alt>Tab', '<Alt>Above_Tab']"
dconf write /org/gnome/desktop/wm/keybindings/switch-applications "[]"
dconf write /org/gnome/desktop/wm/keybindings/switch-applications-backward "[]"

or:

gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<alt>Tab']"
etc...

(As a regular user - not root!!!)

Yogev Neumann

Posted 2012-02-27T01:55:15.547

Reputation: 111

3In bionic, $ dconf write /org/gnome/desktop/wm/keybindings/switch-applications-backward "[]" says error: 0-2:unable to infer type – nealmcb – 2018-05-03T19:08:24.123

Thanks! My alternative to the currently-accepted "cycling-in-place" answer by @pestophagous via the command line is gsettings set org.gnome.desktop.wm.keybindings cycle-windows "['<Alt>Tab']" and gsettings set org.gnome.desktop.wm.keybindings cycle-windows-backward "['<Shift><Alt>Tab']" That allows me to see the windows in context at full resolution, so I can see if e.g. a browser page has the tab I'm looking for. – nealmcb – 2018-05-03T19:23:14.613

@nealmcb I have changed by running dconf gui application and set to not use default but [] – rofrol – 2018-12-19T12:22:51.687

9

Don't know if it works like this for all OSes, but for Ubuntu 18.04 go to: Settings → Devices → Key

Then look for Switch windows which in my case is disabled and set it to Alt + Tab.

This switches between all windows and displays the horizontal selection box if we hold the Alt key down after tabbing.


There are other interesting entries there, namely Switch applications and Switch windows of an application which I have set for Super+Tab and Alt+Super+Tab respectively.

Daniel

Posted 2012-02-27T01:55:15.547

Reputation: 373

You rock dude! Great answer – peter – 2019-01-03T16:18:58.557

Also works for Fedora 30 – Jounathaen – 2019-06-04T12:26:38.517

8

For anyone who is using Ubuntu 18 (to give you the same behavior as e.g. on Windows10):

  • go to settings > devices > keyboard
  • look for the keyboard shortcut for "Switch windows"
  • set this to the shortcut Alt+Tab (this will overwrite the old shortcut)

If you now press Alt+Tab you will be able to directly select all open windows without grouping into the different apps.

Obnebion

Posted 2012-02-27T01:55:15.547

Reputation: 81

This is the answer right now. It is buildin. – janw – 2019-03-19T09:24:41.053

Right, since 2018, this is the way recommended by the AlternateTab extension author. Discussion on reddit

– Robin A. Meade – 2019-11-24T02:45:16.340

1

Script for executing on the command line (based on Mad Physicist's awesome answer):

gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "['<Shift><Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Alt>Tab']"
gsettings set org.gnome.shell.window-switcher current-workspace-only "false"

Duco

Posted 2012-02-27T01:55:15.547

Reputation: 111

1

This post has shed some light on the subject. By accessing apps -> metacity -> global_keybindings on gconf-editor there's a key called switch_group, which is mapped to <Alt>Above_Tab. Changing that to <Alt>Tab should solve the issue.

Waldir Leoncio

Posted 2012-02-27T01:55:15.547

Reputation: 3 158

@HoàngLong, Metacity was a popular GTK2 window manager. Modern OSs have moved on to GTK3 several years ago, so my 6-year old solution is likely not working for up-to-date systems. – Waldir Leoncio – 2019-03-12T17:22:57.433

Hi wleoncio, the above post is telling about a different problem (compared with the question). I tried with your answer, but nothing happened – Hoàng Long – 2012-05-30T07:39:24.387

1

You can use the a different application switcher - can enabled using compizconfig-settings-manager.

See good info on CompizConfig in Ubuntu. It can also be installed on openSUSE and probably other distributions.

Result example: enter image description here

AlikElzin-kilaka

Posted 2012-02-27T01:55:15.547

Reputation: 1 341

0

The way I was able to do it was install the dconf editor from the Ubuntu Software Store. From there, you can follow the path -> /org.gnome/desktop/wm/keybindings. Path View

If you scroll down, you will see switch-applications which I change to ['Tab'] and right below it is switch-application-backwards which is now ['Tab'].

Switch Applications

Scrolling down, you will see switch-windows and switch-windows-backwards. You can set this to ['Tab'] and ['Tab'] respectively.

Switch Windows Settings

Just figured Id share. New to Ubuntu and this took me about an hour of googling to figure out. This definitely works.

Sam Spencer

Posted 2012-02-27T01:55:15.547

Reputation: 1

0

You don't need to download anything, nor even use a gui if you do:

gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']"

Obviously, you can leave the keybinding for switch-applications blank ("[]") if you never want to use it.

This works on Ubuntu 18.04.

borizzzzz

Posted 2012-02-27T01:55:15.547

Reputation: 101

You need to handle the backward cases as well: switch-applications-backward and switch-windows-backward. – Robin A. Meade – 2019-11-24T02:48:09.797

0

In Gnome Shell on Gnome 3.34.3 in Ubuntu 19.10 x86_64, Settings, Devices, Keyboard Shortcuts, Navigation, Switch windows "Alt+Tab" doesn't group, but also doesn't include minimized windows like the Coverflow Alt-Tab extension does, which also overrides the normal grouped Switch applications "Super+Tab" for no reason.

Cees Timmerman

Posted 2012-02-27T01:55:15.547

Reputation: 1 240