Skip to content

Instantly share code, notes, and snippets.

@fobiasmog
Forked from kurozael/UbuntuSwapCtrlCmdKeys.md
Last active January 29, 2025 11:46
Show Gist options
  • Save fobiasmog/f641c32f8d97f1f545433566147f7456 to your computer and use it in GitHub Desktop.
Save fobiasmog/f641c32f8d97f1f545433566147f7456 to your computer and use it in GitHub Desktop.
How to swap the Ctrl and Cmd keys when using Ubuntu.

If you're looking to swap the Ctrl + Cmd keys in Ubuntu 16.04 either just because, or because you're using VirtualBox with an Ubuntu guest and an OSX host, then the answer you're looking for is here. Courtesy of Joel Koh.

Source

http://askubuntu.com/questions/131900/how-do-i-switch-the-command-key-and-control-key-on-a-macbook-pro

Instructions

  1. Launch terminal
  2. Edit X Keyboard Extension

nano /usr/share/X11/xkb/symbols/pc

  1. Make the following changes. Ensure your file looks like this:
modifier_map Control { Control_L, Control_R, Super_L, Super_R };
  1. Clear xkb's cache or reboot

rm -rf /var/lib/xkb/*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment