Skip to content

Instantly share code, notes, and snippets.

@sebastorama
Created July 7, 2023 22:10
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 sebastorama/da2a98a8b8c8d6532345262fd634c740 to your computer and use it in GitHub Desktop.
Save sebastorama/da2a98a8b8c8d6532345262fd634c740 to your computer and use it in GitHub Desktop.
Caps Lock acts as another modifier, appending tmux prefix key (Ctrl+b) to some keys. For use with karabiner
{
"title": "Caps Lock Modifications",
"rules": [
{
"description": "Caps Lock Modifications",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 1
}
}
],
"to_after_key_up": [
{
"set_variable": {
"name": "caps_lock pressed",
"value": 0
}
}
],
"to_if_alone": [
{
"key_code": "out"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "d",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "f1"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "f",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "f2"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "open_bracket",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "open_bracket"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "return_or_enter",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "w"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "c",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "c"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "s",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "s"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "m",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "m"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "semicolon",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "semicolon",
"modifiers": ["left_shift"]
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "spacebar",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "spacebar"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "z",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "z"
}
],
"type": "basic"
},
{
"conditions": [
{
"name": "caps_lock pressed",
"type": "variable_if",
"value": 1
}
],
"from": {
"key_code": "o",
"modifiers": {
"optional": ["any"]
}
},
"to": [
{
"key_code": "b",
"modifiers": ["left_control"]
},
{
"key_code": "o"
}
],
"type": "basic"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment