2023/08/02
On ubuntu:
# X11 keyboard options contain the codes that can be passed as options
man xkeyboard-config
# dconf controls how your keyboard(s) behave -- including lighting the caps-lock
# indicator
dconf_opts="/org/gnome/desktop/input-sources/xkb-options"
dconf read $dconf_opts
dconf write $dconf_opts "[$values]" # where values are taken from `man xkeyboard-config`
# notably, dconf's settings clobber those set by `setxkbmap` and
# `/etc/default/keyboard`'s XKBOPTIONS variable
setxkbmap -query # prints the current key-map settings
setxkbmap -option $values # <- these changes show up in Settings>Keyboard>${CurrentLayout}
cat /etc/default/keyboard | grep XKBOPTIONS
xev # opens a window and prints the events it sees -- including keypress events
# with key codes