How to remap keys in Ubuntu 18.04 (GNOME Shell)

Using xkb worked.

Edit this file: /usr/share/X11/xkb/symbols/pc. Don't forget to use sudo with something like sudo -i gedit /usr/share/X11/xkb/symbols/pc

It'll be fairly straight forward what's going on in there. Key is defined on the left, and effect is defined on the right. Maintain the indentation and all that.

Should work for any kind of remapping.

You'll need to log out and back in (or use the following commands) for changes to take effect:

setxkbmap fr # if you are using french azerty layout
setxkbmap us # if you are using US qwerty layout
... And so on