Skip to content

Instantly share code, notes, and snippets.

@AnanthVivekanand
Created May 21, 2024 18:43
Show Gist options
  • Save AnanthVivekanand/da9c1b09540fd7fe861ab2ff2d59ea8e to your computer and use it in GitHub Desktop.
Save AnanthVivekanand/da9c1b09540fd7fe861ab2ff2d59ea8e to your computer and use it in GitHub Desktop.
cmd + alt + ctrl - s : yabai -m space --focus recent
cmd + alt + ctrl - b : yabai -m space --balance
cmd + alt + ctrl - f : yabai -m window --toggle float
cmd + alt + ctrl - m : yabai -m window --grid 1:1:0:0:1:1
cmd + alt + ctrl - x : yabai -m space --layout bsp
cmd + alt + ctrl - z : yabai -m space --layout float
ctrl - d : yabai -m window --focus recent
ctrl - w: yabai -m window --display recent
cmd - right: yabai -m window --focus next
cmd - left: yabai -m window --focus prev
cmd + alt + ctrl - right: yabai -m space --focus next
cmd + alt + ctrl - left: yabai -m space --focus prev
cmd + alt + ctrl - y: brew install yabai
yabai -m config layout bsp
yabai -m config top_padding 20
yabai -m config bottom_padding 20
yabai -m config left_padding 20
yabai -m config right_padding 20
yabai -m config window_gap 20
yabai -m config mouse_modifier fn
yabai -m config mouse_action1 move
yabai -m config mouse_action2 resize
yabai -m config focus_follows_mouse autofocus
yabai -m config window_shadow off
yabai -m config window_opacity on
yabai -m config active_window_opacity 1.0
yabai -m config normal_window_opacity 0.95
yabai -m config window_opacity_duration off
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false,
"unsafe_ui": true
},
"profiles": [
{
"complex_modifications": {
"parameters": {
"basic.simultaneous_threshold_milliseconds": 50,
"basic.to_delayed_action_delay_milliseconds": 500,
"basic.to_if_alone_timeout_milliseconds": 1000,
"basic.to_if_held_down_threshold_milliseconds": 500,
"mouse_motion_to_scroll.speed": 100
},
"rules": [
{
"description": "Map left ctrl to command, command to option, option to control unless in iTerm2 or Remote Desktop",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"com\\.microsoft\\.rdc\\.mac"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"vendor_id": 1452
}
],
"type": "device_if"
}
],
"from": {
"key_code": "left_command",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_option",
"lazy": true
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"com\\.microsoft\\.rdc\\.mac"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"vendor_id": 1452
}
],
"type": "device_if"
}
],
"from": {
"key_code": "left_control",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "right_command",
"lazy": true
}
],
"type": "basic"
},
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"com\\.microsoft\\.rdc\\.mac"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"vendor_id": 1452
}
],
"type": "device_if"
}
],
"from": {
"key_code": "left_option",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "left_control",
"lazy": true
}
],
"type": "basic"
}
]
},
{
"description": "Map left option+tab to command+tab",
"manipulators": [
{
"conditions": [
{
"identifiers": [
{
"vendor_id": 1452
}
],
"type": "device_if"
}
],
"from": {
"key_code": "tab",
"modifiers": {
"mandatory": [
"left_option"
],
"optional": [
"any"
]
}
},
"to": [
{
"key_code": "tab",
"modifiers": [
"left_command"
]
}
],
"type": "basic"
}
]
},
{
"description": "Change shift + delete to forward delete (rev 2)",
"manipulators": [
{
"conditions": [
{
"bundle_identifiers": [
"^com\\.apple\\.Terminal$",
"^com\\.googlecode\\.iterm2$",
"com\\.microsoft\\.rdc\\.mac"
],
"type": "frontmost_application_unless"
},
{
"identifiers": [
{
"vendor_id": 1452
}
],
"type": "device_if"
}
],
"from": {
"key_code": "delete_or_backspace",
"modifiers": {
"mandatory": [
"shift"
],
"optional": [
"caps_lock",
"option"
]
}
},
"to": [
{
"key_code": "delete_forward"
}
],
"type": "basic"
}
]
},
{
"description": "Open Notion",
"manipulators": [
{
"from": {
"key_code": "n",
"modifiers": {
"mandatory": [
"control"
]
}
},
"to": [
{
"shell_command": "open /Applications/Firefox.app -u https://www.notion.so/Things-to-do-before-each-day-61799a1c50e347babf1aa00a64c1cd0c"
}
],
"type": "basic"
}
]
}
]
},
"devices": [
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 636,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [
{
"from": {
"key_code": "right_command"
},
"to": [
{
"key_code": "right_control"
}
]
},
{
"from": {
"key_code": "right_control"
},
"to": [
{
"key_code": "right_command"
}
]
}
],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 41265,
"vendor_id": 1241
},
"ignore": false,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": true,
"product_id": 41265,
"vendor_id": 1241
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 636,
"vendor_id": 1452
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": true,
"is_pointing_device": false,
"product_id": 34304,
"vendor_id": 1452
},
"ignore": false,
"manipulate_caps_lock_led": true,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
},
{
"disable_built_in_keyboard_if_exists": false,
"fn_function_keys": [],
"identifiers": {
"is_keyboard": false,
"is_pointing_device": true,
"product_id": 20070,
"vendor_id": 1121
},
"ignore": true,
"manipulate_caps_lock_led": false,
"simple_modifications": [],
"treat_as_built_in_keyboard": false
}
],
"fn_function_keys": [
{
"from": {
"key_code": "f1"
},
"to": [
{
"consumer_key_code": "display_brightness_decrement"
}
]
},
{
"from": {
"key_code": "f2"
},
"to": [
{
"consumer_key_code": "display_brightness_increment"
}
]
},
{
"from": {
"key_code": "f3"
},
"to": [
{
"key_code": "f3"
}
]
},
{
"from": {
"key_code": "f4"
},
"to": [
{
"key_code": "launchpad"
}
]
},
{
"from": {
"key_code": "f5"
},
"to": [
{
"key_code": "illumination_decrement"
}
]
},
{
"from": {
"key_code": "f6"
},
"to": [
{
"consumer_key_code": "rewind"
}
]
},
{
"from": {
"key_code": "f7"
},
"to": [
{
"consumer_key_code": "play_or_pause"
}
]
},
{
"from": {
"key_code": "f8"
},
"to": [
{
"consumer_key_code": "fastforward"
}
]
},
{
"from": {
"key_code": "f9"
},
"to": [
{
"consumer_key_code": "fastforward"
}
]
},
{
"from": {
"key_code": "f10"
},
"to": [
{
"consumer_key_code": "mute"
}
]
},
{
"from": {
"key_code": "f11"
},
"to": [
{
"consumer_key_code": "volume_decrement"
}
]
},
{
"from": {
"key_code": "f12"
},
"to": [
{
"consumer_key_code": "volume_increment"
}
]
}
],
"name": "Default profile",
"parameters": {
"delay_milliseconds_before_open_device": 1000
},
"selected": true,
"simple_modifications": [
{
"from": {
"key_code": "caps_lock"
},
"to": [
{
"key_code": "escape"
}
]
}
],
"virtual_hid_keyboard": {
"country_code": 0,
"indicate_sticky_modifier_keys_state": true,
"mouse_key_xy_scale": 100
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment