Skip to content

Instantly share code, notes, and snippets.

@digiter
Last active December 2, 2022 19:48
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save digiter/767f5a46894fbe3b8f075887ba1ada5c to your computer and use it in GitHub Desktop.
Save digiter/767f5a46894fbe3b8f075887ba1ada5c to your computer and use it in GitHub Desktop.
Map Command Key to Control For ubuntu + mac keyboard

For each machine running xmodmap will give you the mapping and keycode, take a look first then write the script. I use ubuntu and mac keyboard. The below maps both left and right control and super.

Create an .Xmodmap file in your Linux home directory, with the following contents, then execute xmodmap .Xmodmap

clear control
clear mod4

keycode 37 = Super_L
keycode 105 = Super_R
keycode 133 = Control_L
keycode 134 = Control_R 

add control = Control_L
add control = Control_R
add mod4 = Super_L
add mod4 = Super_R
@huesmiles49
Copy link

thank you

@rbreaves
Copy link

rbreaves commented Feb 15, 2020

This may work generally, but for the terminal apps it won't remap or give you copy and paste without additional work. You can take a look at my project for something that will remap itself any time a terminal app takes the focus. (can be extended to do more, but I haven't seen much need for that) https://github.com/rbreaves/kinto

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