This allows you to do Cmd+Shift+X
at any time to trigger a screen lock.
You can actually do this natively by setting up an Automator script, but that won't work in programs that manually bind to that key combination (e.g. Slack, for strikethrough).
(Doing it with Karabiner Elements will override any existing keybind.)
How to install
Add to ~/.config/karabiner/assets/complex_modifications
.
See https://pqrs.org/osx/karabiner/json.html for more info.