Ubuntu – How to make gnome-tweaks changes apply to a newly plugged in USB keyboard without going through the GUI

gnome-tweakskeyboardkeyboard-layout

I use gnome-tweaks to turn my Caps Lock into a Control Key. This works normally, but not when I plug in a new external keyboard. I can make it work by:

  1. Opening gnome-tweaks
  2. Getting to the right place on the GUI: Keyboard & Mouse -> Additional Layout Options -> Caps Lock behaviour
  3. Flipping between any other option and "Caps Lock is also a Ctrl"

Is there some terminal command I can run that will refresh gnome-tweaks for my currently plugged in devices? Failing that, is there a command I can run that will do this switch I'm currently doing manually?

This is a bug, but it's affecting my current version and the above would serve as a workaround.

Best Answer

This is untested, but you may want to try:

gsettings reset org.gnome.desktop.input-sources xkb-options
gsettings set org.gnome.desktop.input-sources xkb-options "['caps:ctrl_modifier']"
Related Question