Force alt + tab to switch only on current workspace in GNOME shell

52,304

Solution 1

Here is the solution I came up with:

Very fast & easy, without any installations/extensions:

  1. Install dconf-editor (already installed on current debian/ubuntu distributions):

    sudo apt-get install dconf-editor
    
  2. Open dconf-editor (from the Dash or a Terminal)

  3. Navigate to: org -> gnome -> shell -> app-switcher
  4. Set "current-workspace-only" to true

    screenshot

..and you're done :)

Solution 2

Simply:

gsettings set org.gnome.shell.app-switcher current-workspace-only true

Solution 3

As an alternative to installing dconf-editor and having to fiddle around with your mouse so much, you can also do this from terminal.

To create the current-workspace-only value:

dconf write /org/gnome/shell/app-switcher/current-workspace-only 'true'

To erase it, going back to default settings:

dconf reset /org/gnome/shell/app-switcher/current-workspace-only

I would like dconf-editor more if it could search through paths, properties, and values.

Solution 4

Seems to be fixed with

gsettings set org.gnome.shell.window-switcher current-workspace-only true
gsettings set org.gnome.shell.app-switcher current-workspace-only true

Solution 5

An alternative for people who want to tab through open windows on current workspace but also want to be able to tab through all open apps (on any workspace) this can be achieved by changing the keyboard shortcuts.

Under Settings > Devices > Keyboard (on Ubuntu 17.10):

  • Switch Windows: Alt+Tab
  • Switch Applications: Super+Tab
Share:
52,304

Related videos on Youtube

daniel451
Author by

daniel451

Updated on September 18, 2022

Comments

  • daniel451
    daniel451 almost 2 years

    I am looking for a clean and fast method to force GNOME in Ubuntu 14.04 to switch between active apps only on the current workspace when pressing the shortcut alt + tab.

  • leo-the-manic
    leo-the-manic over 7 years
    Wish Gnome would just put this in their Settings applet
  • Jamie-505
    Jamie-505 over 7 years
    super fast, no extra software necessary and does exactly what was asked for! +1
  • Mihail Malostanidis
    Mihail Malostanidis over 6 years
    Please add @austinmarton answer too, since while this is more generic, there's a gnome way that requires no extra installs.
  • n1k31t4
    n1k31t4 over 6 years
    This isn't working for me on Ubuntu 16.04. I think it might be due to these settings being managed in several different apps. Any idea how to make this setting overrule the others?
  • Esteban Filardi
    Esteban Filardi over 6 years
    It worked for me on Ubuntu 17.04
  • colan
    colan over 6 years
    ...and for me in 17.10.
  • Rick-777
    Rick-777 over 6 years
    That's tricky - Alt+Tab changes windows, even when changing the keyboard shortcuts. Is there a way to fix that?
  • Clauds
    Clauds over 6 years
    Yes, Alt+Tab will show the windows open on the current workspace whereas Super+Tab will show all open programs (on any workspace). What do you want to achieve, that Alt+Tab shows open programs on the current workspace instead of open windows?
  • michael
    michael over 6 years
    the (later) answer using gsettings is just a higher-level api that also sets the dconf values (and would probably be in general preferred over directly accessing dconf)
  • kerner1000
    kerner1000 over 6 years
    Looks like I need only the first one (.window-switcher)
  • sobi3ch
    sobi3ch over 6 years
    I've added feature issue to Gnome TWEAK project gitlab.gnome.org/GNOME/gnome-tweaks/issues/123
  • samb
    samb over 6 years
    Wish this will become the default for future release!
  • Biggybi
    Biggybi about 6 years
    Hi ! I'm trying to set this specific behavior, but I don't seem to be able to. Both commands always behave the same. I tried gsettings current-workspace-only for window and app switcher with no luck either. Any idea? Thanks :)
  • Clauds
    Clauds about 6 years
    I checked my gsettings and I have org.gnome.shell.app-switcher current-workspace-only false and org.gnome.shell.window-switcher current-workspace-only true
  • Andrea Tulimiero
    Andrea Tulimiero about 6 years
    It's working on Ubuntu 18.04. It's straightforward and you don't need to install anything
  • rtindru
    rtindru about 6 years
    This should be on Gnome Tweak! Agree @sobi3ch
  • GuruBob
    GuruBob about 6 years
    As of Ubuntu 18.04 this setting can be found at /org/gnome/shell/window-switcher/current-workspace-only
  • k_g
    k_g almost 6 years
    Strangely, it doesn't work for me in 18.04, but this extension does: extensions.gnome.org/extension/310/alt-tab-workspace
  • crafter
    crafter almost 6 years
    Nice. How can I set this as a default for all users.
  • crafter
    crafter almost 6 years
    This does not answer the question but is a great tip nonetheless.
  • EoghanM
    EoghanM almost 6 years
    @GuruBob I've got both of these settings available in dconf in 18.04, however the shell/app-switcher one listed in the answer was the one that I needed to change.
  • carlo.polisini
    carlo.polisini almost 6 years
    WARNING: For me in Ubuntu 18.04 does not work, but the command line version worked: gsettings set org.gnome.shell.app-switcher current-workspace-only true
  • juliangonzalez
    juliangonzalez over 5 years
    This did the job. It only shows the apps currently in the workspace and, when an app has two instance each in a different workspace when pressing Alt+Tab it prevents from showing both of them. But you have to use both the commands in this answer. Awesome, thank you!
  • Daniel Buckmaster
    Daniel Buckmaster almost 5 years
    This is great, thanks! Just did this in Ubuntu 18.04 and it's really helpful. It seems I didn't have Alt+Tab bound to anything originally (but it still performed the 'switch applications' action). After binding Alt+Tab to 'switch windows', I had to re-bind Super+Tab to 'switch applications' for some reason.
  • wjandrea
    wjandrea almost 5 years
  • RichieHH
    RichieHH over 4 years
    Debian Buster : the first line did it for me.
  • Dmitry Shevkoplyas
    Dmitry Shevkoplyas over 4 years
    This should be the accepted answer! Works on Ubuntu 18.04. thank you, thank you, thank you!!!
  • Tahlor
    Tahlor about 4 years
    If it doesn't work, you can try replacing gsettings with the fully qualified /usr/bin/gsettings. Package managers like Anaconda can muck with the default gsettings alias.
  • Jong
    Jong about 4 years
    Works on 20.04 as well.
  • Thiru VT
    Thiru VT about 4 years
    Does not work for me on 18.04.
  • M1ke
    M1ke over 3 years
    Does anybody know if this is possible but for screens? I.e. alt tab between stuff on the screen I am currently interacting with, but not other screens. I like to have one screen with a fixed set of tools (email, slack etc) and then my main screen for active work, but alt tab will select slack or email rather than switching between two tools I am using on my primary screen
  • Marc-François
    Marc-François over 2 years
    This worked for me on 21.10.
  • KFO
    KFO over 2 years
    This solution work still on Ubuntu 21.10. Perfect.
  • Kvothe
    Kvothe over 2 years
    Does this only work for "Switch Applications" or also for "Switch Windows"?
  • Admin
    Admin about 2 years
    For keys that don't exist yet, dconf does not let you auto complete them, while gsettings does. f.e. dconf write /org/gnome/shell/app-sw then pressing tab does not complete to anything, but gsettings set org.gnome.shell.app-sw then pressing tab completes to gsettings set org.gnome.shell.app-switcher