Caps-lock remapping stops working

I have caps-lock key remapped to control, which usually works fine, but after some uptime and one/more suspend/awake cycles* this mapping breaks, and caps-lock reverts back to the default behavior -- i.e. turning on the led and capitalizing whatever I type. (Even though the Tweaks UI still shows it as being mapped to Ctrl -- see picture below.)

Tweaks UI

Questions:

  • Is this a known issue (with maybe a known fix)? (Could not find anything relevant with a quick search.)
  • Is there a way to debug the problem, preferably from the command line?

*Remark: I'm not sure it is the suspend/awake cycle that causes the problem, but I can't connect it to anything else...

Remark2: removing and readding the mapping (or rebooting) solves the problem, but it would be nice to find a more permanent solution.


Solution 1:

As a workaround when the mapping breaks, restart gnome shell via:

  • Alt+F2
  • type r
  • hit enter

so it works again until it breaks again.

Solution 2:

It's bug #1899206. There is this PPA with the assumed fix, and if you want to fix it for yourself before the bug gets fixed in 20.04 officially, you can install the mutter packages from the PPA and reboot.