8

After upgrading and getting the last version of Gnome+Wayland, it kind of mostly broke Autokey (even login with Gnome3 on Xorg). After so much time spent trying to get Command+c to copy instead of Control+c (Iuse a Mac keyboard and frequently switch computers), I am at a point where I am about to get rid of Gnome 3 altogether, just because it does not allow me to redefine Cut Copy and Paste keyboard shortcuts. Those who, like me, spend most of their time working in Terminal will understand.

I think my last chance is simply to edit the source code (Gnome3, Wayland, or wherever this is) and recompile the package, but I searched and searched and was unable to find where the keyboard shortcuts or keybindings were set!

Does anyone here know or have any pointers?

migrated from stackoverflow.com Feb 5 '17 at 11:19

This question came from our site for professional and enthusiast programmers.

1

I don't know whether these will work with GNOME wayland (I've tested this with earlier versions, with X11, but I think that it should be independent of the server protocol).

Keybindings in general GTK-3.0 "text-boxes" (gedit, nautilus, firefox)

mkdir -p ~/.themes/macos/gtk-3.0/
cp /usr/share/themes/Emacs/gtk-3.0/gtk-keys.css ~/.themes/macos/gtk-3.0/
$EDITOR ~/.themes/macos/gtk-3.0/gtk-keys.css

In the gtk-keys.css file, edit the bindings as you see fit — they're pretty self-explanatory. The lines that would be of particular interest are:

bind "<ctrl>w" { "cut-clipboard" () };
bind "<ctrl>y" { "paste-clipboard" () };

which you should change to (super is typically the "Command" key):

bind "<super>x" { "cut-clipboard" () };
bind "<super>v" { "paste-clipboard" () };
bind "<super>c" { "copy-clipboard" () };

You may want to delete the remaining bindings.

In order to enable your new macos key theme, use gsettings:

gsettings set org.gnome.desktop.interface gtk-key-theme 'macos'

Keybindings in gnome-terminal

dconf write /org/gnome/terminal/legacy/keybindings/copy  \'"<Super>c"\'
dconf write /org/gnome/terminal/legacy/keybindings/paste \'"<Super>v"\'
0

I'm assuming that you've tried any relevant keyboard settings dialogues; for me, on Linux Mint MATE, I have a special settings window for this.

You may be able to use the dconf-editor to set these; I've needed to do that many times for my hotkeys. For my system, the relevant location on the tree is org->mate->desktop->keybindings. You may be able to set it that way. If not, you could do it the "wrong way" and set it as a hotkey for xdotool to type the "correct" binding.

If all else fails, I'm not sure if this would be sufficient, but you may be able to set those bindings directly in the terminal, under Edit->Preferences.

0

Not sure if you've already tried this, but setkeycodes might be worth looking into.

Also, here's a potentially relevant superuser question: How to disable / re-map keyboard keys in the kernel?

Maybe you can re-map cmd to ctrl with this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.