I'm using xmodmap to swap control and command keys on my Macbook pro. However, periodically the key revert back to their original state and this is becoming quite annoying.

I'm on Ubuntu 13.10 and I can remember when this situation started occurring was when the system got a keyboard settings (in the system settings) update. Any ideas as to how to either:

  1. delete the keyboard settings, or
  2. stop the keyboard settings from reverting my keys?

Does it happen when your PC goes to sleep? If so, make sure the keyboard is plugged into the PC and not the monitor. Xmodmap settings are not honored when keyboard devices are hotplugged.


I believe that gnome is reverting the caps behavior, I had this problem as well.

You can change the gnome settings with gnome-tweaks (which you can apt install if you don't have it already)

Then run gnome-tweaks, select "Keyboard and Mouse" and then "Advanced Layout Options" - and then you can choose the caps lock behavior there instead of calling xmodmap.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.