Score:0

set shortcut to move between windows in reverse

gf flag

version: Ubuntu 18.04

i want to move between windows and work spaces in a "vim-like" way.

I set ctrl+alt u/d to move up/down work spaces, and changed alt tab (switch between windows -->) to ctrl+alt+l. And I want to move in reverse order (<--) using ctrl+alt+h.

The documentation suggests this is done using the shift key: https://help.ubuntu.com/stable/ubuntu-help/shell-windows-switching.html.en.

But I cannot see it listed in the settings where i can change it. Under keyboard shortcuts i see only "switch windows" (where i easily changed it from alt tab to ctrl+alt+l) but not switch windows in reverse order.

How can i set the shortcut to switch windows in reverse order?

vanadium avatar
cn flag
This depends on the desktop environment and window manager. We have no idea what desktop environment you use, although there is a strong suspicion it will be the standard Ubuntu desktop with Gnome Shell. *Edit* your question and add system specs: Ubuntu version and desktop environment.
neverdimed avatar
gf flag
sorry, it slipped my mind: ubuntu 18.04
Score:1
cn flag

With following commands, you can bind Ctrl+AltL/H to directly switch windows forward and backward. The commands given preserve the default bindings as well:

gsettings set org.gnome.desktop.wm.keybindings cycle-windows "['<Alt>Escape', '<Control><Alt>l']"
gsettings set org.gnome.desktop.wm.keybindings cycle-windows-backward "['<Shift><Alt>Escape','<Control><Alt>h']"

Alternatively, you could switch forward and backwards in the window popup with the commands.

gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Control><Alt>l']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Control><Alt>h']"

Depending on the Ubuntu version, these keys may already be bound to Alt+Tab, so you could add <Alt>Tab or <Shift><Alt>Tab.

The latter binding can be set in "Settings", "Keyboard", but that interface allows to set only one binding at a time.

To undo your changes and return these settings to default, replace set by reset and remove the last argument.

neverdimed avatar
gf flag
thanks a lot for this. I'm trying to add it using the interface in settings: name: Switch windows backward / command: switch-windows-backward / shortcut: [i just enter the keys and it records them] / i guess i have the command wrong?
vanadium avatar
cn flag
My bad: arguments in commands should be quoted: corrected this.
neverdimed avatar
gf flag
excellent, it works!, cheers
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.