Skip to content

Instantly share code, notes, and snippets.

@gtello
Created August 24, 2023 15:27
Show Gist options
  • Save gtello/a4cccae4efaa14c1646396e95f6de549 to your computer and use it in GitHub Desktop.
Save gtello/a4cccae4efaa14c1646396e95f6de549 to your computer and use it in GitHub Desktop.
Swap control and caps lock on Wayland Ubuntu 23.04

On Wayland, the configuration of keyboard layouts and remapping keys is typically managed by tools that are specific to the compositor you're using. If you're using Ubuntu with GNOME on Wayland, the compositor is Mutter, which means you'll use GNOME's settings and configurations.

For swapping the Caps Lock and Left Control keys on GNOME under Wayland, you can use the gsettings command. Here's what you need to do:

Backup your current settings (just in case you want to revert back):

gsettings get org.gnome.desktop.input-sources xkb-options

Swap Caps Lock and Left Control:

gsettings set org.gnome.desktop.input-sources xkb-options "['ctrl:swapcaps']"

If you ever want to reset to the default settings:

gsettings reset org.gnome.desktop.input-sources xkb-options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment