Skip to content

Instantly share code, notes, and snippets.

@dapicester
Last active June 4, 2022 15:49
Show Gist options
  • Save dapicester/4dd3eaca79d70c04942a2f7151cb0a41 to your computer and use it in GitHub Desktop.
Save dapicester/4dd3eaca79d70c04942a2f7151cb0a41 to your computer and use it in GitHub Desktop.
Swap mouse buttons for Orbit Wireless
#!/bin/bash
case $1 in
1|on|yes|true)
karabiner_cli --set-variables "{\"orbit_swap_buttons\":1}"
;;
0|off|no|false)
karabiner_cli --set-variables "{\"orbit_swap_buttons\":0}"
;;
*)
;;
esac
current=$(jq '.variables.orbit_swap_buttons // 0' "/Library/Application Support/org.pqrs/tmp/karabiner_grabber_manipulator_environment.json")
echo "Orbit swap buttons: $current"
{
"title": "Swap mouse buttons for lef-hand Orbit",
"rules": [
{
"description": "Swap left-right mouse buttons",
"manipulators": [
{
"type": "basic",
"conditions": [
{
"type": "variable_if",
"name": "orbit_swap_buttons",
"value": 1
},
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1149,
"product_id": 32936,
"is_pointing_device": true,
"description": "ORBIT BT5"
},
{
"vendor_id": 1149,
"product_id": 32935,
"is_pointing_device": true,
"description": "ORBIT"
},
{
"vendor_id": 1149,
"product_id": 32934,
"is_pointing_device": true,
"description": "ORBIT WIRELESS TB"
}
]
}
],
"from": {
"pointing_button": "button1",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"pointing_button": "button2"
}
]
},
{
"type": "basic",
"conditions": [
{
"type": "variable_if",
"name": "orbit_swap_buttons",
"value": 1
},
{
"type": "device_if",
"identifiers": [
{
"vendor_id": 1149,
"product_id": 32936,
"is_pointing_device": true,
"description": "ORBIT BT5"
},
{
"vendor_id": 1149,
"product_id": 32935,
"is_pointing_device": true,
"description": "ORBIT"
},
{
"vendor_id": 1149,
"product_id": 32934,
"is_pointing_device": true,
"description": "ORBIT WIRELESS TB"
}
]
}
],
"from": {
"pointing_button": "button2",
"modifiers": {
"optional": [
"any"
]
}
},
"to": [
{
"pointing_button": "button1"
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment