Swapping two keys

You can create xkb/symbols/ directory under .config in your home
mkdir -p ~/.config/xkb/symbols
and put here the modified file/s you would usually edit under the system directory.