Skip to content

Instantly share code, notes, and snippets.

@kurozael
Created July 17, 2019 11:50
Show Gist options
  • Save kurozael/9a975b5c8a84966dfbfa67d7187d12cf to your computer and use it in GitHub Desktop.
Save kurozael/9a975b5c8a84966dfbfa67d7187d12cf 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:
key <LCTL> {    [ Super_L       ]   };
key <LWIN> {    [ Control_L     ]   };
key <RCTL> {    [ Super_R       ]   };
key <RWIN> {    [ Control_R     ]   };
  1. Clear xkb's cache

rm -rf /var/lib/xkb/*

  1. (Conditional) If the keys are not swapped after step 4, restart your computer. It worked for me after this.

Hope it helps, good luck!

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