vertical-overview icon indicating copy to clipboard operation
vertical-overview copied to clipboard

Add back Super + Page Up/Down to switch workspaces

Open arrufat opened this issue 3 years ago • 10 comments

First, thank you for working on this project, I really like vertical layout and was really sad to see it go with GNOME 40.

So, the feature request is about making the following extra key bindings that we had in the previous GNOME versions:

  • Super (+ Shift) + Page Up/Down = Ctrl + Alt (+ Shift) + Page Up/Down

Where Shift was used to carry the focused window when switching workspaces.

Again, thank you so much for this extension, it's a life-saver!

arrufat avatar Apr 08 '21 15:04 arrufat

They may not appear in the shortcuts UI, but using dconf editor you cant set them directly in the /org/gnome/desktop/wm/keybindings/ schema.

romgrk avatar Apr 08 '21 16:04 romgrk

Following the hint by @romgrk I got to these commands for getting Page-Up & Page-Down to work:

dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-up "['<Super>Page_Up', '<Control><Alt>Up']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-down "['<Super>Page_Down', '<Control><Alt>Down']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-left "['<Super><Alt>Left', '<Control><Alt>Left']"
dconf write /org/gnome/desktop/wm/keybindings/switch-to-workspace-right "['<Super><Alt>Right', '<Control><Alt>Right']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-up "['<Super><Shift>Page_Up', '<Control><Shift><Alt>Up']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-down "['<Super><Shift>Page_Down', '<Control><Shift><Alt>Down']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-left "['<Super><Shift><Alt>Left', '<Control><Shift><Alt>Left']"
dconf write /org/gnome/desktop/wm/keybindings/move-to-workspace-right "['<Super><Shift><Alt>Right', '<Control><Shift><Alt>Right']"

To undo it:

dconf reset /org/gnome/desktop/wm/keybindings/switch-to-workspace-up
dconf reset /org/gnome/desktop/wm/keybindings/switch-to-workspace-down
dconf reset /org/gnome/desktop/wm/keybindings/switch-to-workspace-left
dconf reset /org/gnome/desktop/wm/keybindings/switch-to-workspace-right
dconf reset /org/gnome/desktop/wm/keybindings/move-to-workspace-up
dconf reset /org/gnome/desktop/wm/keybindings/move-to-workspace-down
dconf reset /org/gnome/desktop/wm/keybindings/move-to-workspace-left
dconf reset /org/gnome/desktop/wm/keybindings/move-to-workspace-right

As a feature, maybe it'd be nice set have this run automatically upon enabling/disabling the extension, but I don't have enough experience with extensions to have a good judgement or contribute to the code.

m2-farzan avatar Apr 08 '21 18:04 m2-farzan

It would be a bit tricky, depending on if the user rebinds the shortcuts to something other than the defaults. We could try to intercept the workspace-left/right signal though.

romgrk avatar Apr 08 '21 21:04 romgrk

We could probably allow the user to set these in the extension settings, since this is already working I don't think it has priority. I'll keep the issue open.

RensAlthuis avatar Apr 09 '21 13:04 RensAlthuis

Would also like this implemented but the comment from m2-farzan has helped me apply a fix manually so thanks! P.s. nice extension I much prefer the vertical layout.

thopri avatar May 01 '21 14:05 thopri

This was the first thing I looked for after installing. Might be nice to pin this issue, or put some of m2-farzan's comment into the readme for better visibility.

jakesco avatar May 03 '21 16:05 jakesco

@jakesco Ah yeah, fair point. I'll make sure to add it later today.

RensAlthuis avatar May 03 '21 17:05 RensAlthuis

dconf setting didn't work for me in Fedora 34, with gsettings i had no problems:

My Settings: I removed <Alt> and <Ctrl-Alt> keyboard shortcuts that conflicts with remote emulation (X2Go/nomachine)

vertical

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "['<Super>Page_Up']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "['<Super>Page_Down']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Super><Alt>Left']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Super><Alt>Right']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-up "['<Super><Shift>Page_Up']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-down "['<Super><Shift>Page_Down']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-left "['<Super><Shift><Alt>Left']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-right "['<Super><Shift><Alt>Right']"

horizontal

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-up "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-down "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left "['<Super>Page_Up', '<Super><Alt>Left']"
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-right "['<Super>Page_Down', '<Super><Alt>Right']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-up "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-down "[]"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-left "['<Super><Shift>Page_Up', '<Super><Shift><Alt>Left']"
gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-right "['<Super><Shift>Page_Down','<Super><Shift><Alt>Right' ]"

reset (dconf version)

dconf reset org.gnome.desktop.wm.keybindings switch-to-workspace-up
dconf reset org.gnome.desktop.wm.keybindings switch-to-workspace-down
dconf reset org.gnome.desktop.wm.keybindings switch-to-workspace-left
dconf reset org.gnome.desktop.wm.keybindings switch-to-workspace-right
dconf reset org.gnome.desktop.wm.keybindings move-to-workspace-up
dconf reset org.gnome.desktop.wm.keybindings move-to-workspace-down
dconf reset org.gnome.desktop.wm.keybindings move-to-workspace-left
dconf reset org.gnome.desktop.wm.keybindings move-to-workspace-right

hute37 avatar May 06 '21 08:05 hute37

You can also bring them back into the Settings UI -- at least for my system (Fedora 34), you can find the relevant keybindings in /usr/share/gnome-control-center/keybindings/50-mutter-navigation.xml. In the XML, the options to navigate to a workspace up/ down (as well as the options to move a window to a workspace up/down) are listed, but have a "hidden=true" property on them. You can edit it with root privileges to remove that "hidden" property (or set it to false), and then you can edit the shortcuts with the graphical UI like before.

benscruton avatar Sep 07 '21 19:09 benscruton

Firstly, thank you so much for writing this extension. Horizontal workspaces on two wide monitors are absolutely awful.

The dconf bindings above are helpful to complete the fix and enable the hotkeys that make sense.

If it's hard to integrate them into the package, perhaps they could be listed in the configuration widget for the extension?

ajfclark avatar Dec 07 '21 22:12 ajfclark