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.

Revisions

  1. dapicester revised this gist Jun 4, 2022. 2 changed files with 25 additions and 0 deletions.
    15 changes: 15 additions & 0 deletions orbit_swap.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/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"
    10 changes: 10 additions & 0 deletions swap-mouse-buttons.json
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,11 @@
    {
    "type": "basic",
    "conditions": [
    {
    "type": "variable_if",
    "name": "orbit_swap_buttons",
    "value": 1
    },
    {
    "type": "device_if",
    "identifiers": [
    @@ -48,6 +53,11 @@
    {
    "type": "basic",
    "conditions": [
    {
    "type": "variable_if",
    "name": "orbit_swap_buttons",
    "value": 1
    },
    {
    "type": "device_if",
    "identifiers": [
  2. dapicester created this gist Nov 10, 2021.
    92 changes: 92 additions & 0 deletions swap-mouse-buttons.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,92 @@
    {
    "title": "Swap mouse buttons for lef-hand Orbit",
    "rules": [
    {
    "description": "Swap left-right mouse buttons",
    "manipulators": [
    {
    "type": "basic",
    "conditions": [
    {
    "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": "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"
    }
    ]
    }
    ]
    }
    ]
    }