I am on Ubuntu 18.04 and trying swap Ctrl and CapsLock using xmodmap. But failed to find a way of doing that automatically: .[X|x]modmap[rc] and .config/autostart didn't work. What other ways are there? Could it be possible throgh systemd?
SHORT:
Desktop entry in .config/autostart or /etc/xdg/autostart. Exec is not a full-fledged shell command, so sh -c might be required
[Desktop Entry]
Type=Application
Exec=sh -c "xmodmap ~/.xmodmaprc"