Skip to content

Instantly share code, notes, and snippets.

@qaisjp
Created August 6, 2019 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qaisjp/7f0a1a76d3ac02b674bb0a8a8d15ea2c to your computer and use it in GitHub Desktop.
Save qaisjp/7f0a1a76d3ac02b674bb0a8a8d15ea2c to your computer and use it in GitHub Desktop.
Lock Screen Complex Modification

Karabiner Elements - Lock Screen Complex Modification

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.

{
"title": "Lock Screen",
"rules": [
{
"description": "Cmd+Shift+X to Lock Screen",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "x",
"modifiers": {
"mandatory": [
"command",
"shift"
]
}
},
"to": [
{
"key_code": "q",
"modifiers": [
"left_control",
"left_command"
]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment