Closed ShrirajHegde closed 3 years ago
We have a wiki article about custom shortcuts linked in the readme. What keyboard shortcut have you tried? The defaults are Ctrl+Alt+🠖 (right) and Ctrl+Alt+🠔 (left).
ctrl + super + 🠖 and ctrl + super + 🠔
I think fedora uses this keybinding...(for up and down ad default)
and move window to [left] or [right] works, but [up] or [down] doesn't
ok, shift + super + 🠗/🠕 works for moving and ctrl + shift + alt + 🠔/🠖 works for moving
totally scattered for some reason, probably because super based shortcuts are set by fedora
These are the default keybindings in my Fedora 34 beta VM:
[liveuser@localhost-live ~]$ gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-right
['<Super>Page_Down', '<Super><Alt>Right', '<Control><Alt>Right']
[liveuser@localhost-live ~]$ gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-left
['<Super>Page_Up', '<Super><Alt>Left', '<Control><Alt>Left']
[liveuser@localhost-live ~]$ gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-up
['<Control><Alt>Up']
[liveuser@localhost-live ~]$ gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-down
['<Control><Alt>Down']
So it's either ctrl+alt or super+alt but not ctrl+super.
ok, then I might have overwritten the shortcuts while syncing extensions with https://extensions.gnome.org/extension/1486/extensions-sync/
These are the default keybindings in my Fedora 34 beta VM:
[liveuser@localhost-live ~]$ gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-right ['<Super>Page_Down', '<Super><Alt>Right', '<Control><Alt>Right'] [liveuser@localhost-live ~]$ gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-left ['<Super>Page_Up', '<Super><Alt>Left', '<Control><Alt>Left'] [liveuser@localhost-live ~]$ gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-up ['<Control><Alt>Up'] [liveuser@localhost-live ~]$ gsettings get org.gnome.desktop.wm.keybindings switch-to-workspace-down ['<Control><Alt>Down']
So it's either ctrl+alt or super+alt but not ctrl+super.
is it practical to provide a shortcut picker in the extension?
@ShrirajHegde That will be a good idea I think, I know it's not very hard to implement it if we will ask users to enter their keybindings in text format (like '<Control><Alt>Down'
), but it doesn't seem easy to kind of listen to the shortcut while assigning (even gnome keybindings app doesn't have this feature).
Anyways, I think it's a good idea to have a keybindings section in the preferences, what do you think @mzur?
Sorry but I have a different view. In my opinion we don't gain much by offering keybinding configuration in the settings of this extension. If it's in the text format, why don't just do it in the console? Also, there are a lot of keybindings we would have to support there.
In my view, the place to offer such a thing would be the Keyboard Shortcuts menu in the system settings. On my system (Ubuntu 20.04) this menu does support a "listen to keypress" feature to assign new keybindings. If we could manage to add the missing entries for the "switch left/right" etc. keybindings there, this would have my full support.
yeah, switch to left-right and move to left/right are missing, rest can be set in gnome-control-center
another idea is, checking what keybindings are set for 🠗/🠕 and automatically matching the same for 🠔/🠖 (in both move window or switch to)
the second one would be seamless
I'll opt for adding the missing shortcuts to the system settings for now. I don't want to change the defaults with this extension.
Anyone who wants to contribute is welcome to try to implement this. For GNOME <40 the "left" and "right" keybindings should be added and for GNOME 40 "up" and "down" should be added to the Keyboard Shortcuts menu of the system settings..
Actually, with the current implementation and progress, the key-handling
will be stolen once the switcher
shows up (similar to switching windows/apps/input
in gnome
). So far, I only found one function which will force us to handle keys there and that's what I am going for right now. This will require extension configuration as they are hard coded now. You can actually check that once the switcher
appears in input/windows/app switcher
, it will steal key-handling
and you won't be able to switch workspaces
for example with ctrl+alt+right
.
// handling key presses while the switcher popup is displayed
_keyPressHandler(keysym, action) {
// default keybindings with arrows
if (action == Meta.KeyBindingAction.WORKSPACE_LEFT || keysym == Clutter.KEY_Left)
this.select(this.getTargetWorkspaceIndexByDirection(Meta.MotionDirection.LEFT));
else if (action == Meta.KeyBindingAction.WORKSPACE_RIGHT || keysym == Clutter.KEY_Right)
this.select(this.getTargetWorkspaceIndexByDirection(Meta.MotionDirection.RIGHT));
else if (action == Meta.KeyBindingAction.WORKSPACE_UP || keysym == Clutter.KEY_Up)
this.select(this.getTargetWorkspaceIndexByDirection(Meta.MotionDirection.UP));
else if (action == Meta.KeyBindingAction.WORKSPACE_DOWN || keysym == Clutter.KEY_Down)
this.select(this.getTargetWorkspaceIndexByDirection(Meta.MotionDirection.DOWN));
// todo: maybe add more keybindings from preferences here, and make both arrows and keypads default configs but not hardcoded
else
return Clutter.EVENT_PROPAGATE;
return Clutter.EVENT_STOP;
}
What do you think @mzur?
Will this be good substitute to the current way we implement workspace switcher popup
?
I think switching windows/apps/input
is behaving exactly the same way we desire.
this has potential to solve all of #145 #140 #126 #88 #12
@ebeem I can't say before I had a look at the code. Just do what you think is best and we can continue the discussion in your PR. It's not directly related to this issue, I think. Just a quick comment:
You can actually check that once the switcher appears in input/windows/app switcher, it will steal key-handling and you won't be able to switch workspaces for example with ctrl+alt+right.
This is already the case in older GNOME versions (e.g. 3.36).
I am not handling the keybindings in GNOME 40
anymore, I am getting them from gsettings.
So I think for this issue, we just need to have a ready script to assign the default keybindings (Ctrl+Alt+arrows
) as @mzur suggested.
Section added to https://github.com/mzur/gnome-shell-wsmatrix/wiki/Custom-keyboard-shortcuts
I second @mzur now with the keybindings managed by another tool, we need a better tool to manage all of GNOME
's keybindings rather than building an interface for it in each and every extension.
This extension doesn't actually create any additional keybindings (except for the workspace toggle part). All the keybindings used here are built-in GNOME
. So I think there's no need to manage them in this extension.
You can see that gsettings
will allow you to list/get/set all keybindings, check gsettings list-recursively
.
dconf-editor
can be used to check and modify these keybindings, it's a good interface but I don't like how it handles assigning keybindings (you need to manually provide it as a string, e.g. ['<Control><Shift><Alt>Left']
.
GNOME Keyboard
on the other hand doesn't show all available keybindings. However, its interface is great and it allows you to easily set shortcuts just by pressing them (no need to provide it as a string).
Please feel free to reopen this if you still think it's a needed feature, maybe we can discuss it further.
Switching left-right doesn't work in Fedora, but a comment on https://extensions.gnome.org/extension/1485/workspace-matrix/ has a method to fix this problem.
" by lbecea Overall it is a nice and useful extension. Unfortunately for Pop!_os 20.10 switching left/right didn't work
Fortunately, I found this two commands to fix it:
"
Can you make these keybinding settings automatically during installation/mention this in README?