答案1
启用:
gsettings set org.gnome.desktop.input-sources xkb-options "['caps:ctrl_modifier']"
禁用:
gsettings set org.gnome.desktop.input-sources xkb-options "[]"
也可以看看https://askubuntu.com/questions/971067/how-can-i-script-the-settings-made-by-gnome-tweak-tool
编辑:要解决下面唐的评论,您可以运行gsettings get org.gnome.desktop.input-sources xkb-options
以查看是否xkb-options
已设置任何其他内容。如果有,您也可以将它们合并到 gsetting 命令中,例如您可能有gsettings set org.gnome.desktop.input-sources xkb-options "['altwin:menu', 'caps:ctrl_modifier']"