{"title": "Rules for Karabiner-Elements",
  "rules": [
    { "description": "Press a Key Twice, right_command - Rule - Karabiner-Elements",
      "manipulators": [
        {
          "type": "basic",
          "from": {
            "key_code": "right_command",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "shell_command": "/bin/bash ~/.local/bin/auto-raise.sh 2>&1 >/dev/null"
            }
          ],
          "conditions": [
            {
              "type": "variable_if",
              "name": "key pressed",
              "value": 1
            }
          ]
        },

        {
          "type": "basic",
          "from": {
            "key_code": "right_command",
            "modifiers": {
              "optional": [
                "any"
              ]
            }
          },
          "to": [
            {
              "set_variable": {
                "name": "key pressed",
                "value": 1
              }
            },
            {
              "key_code": "right_command"
            }
          ],
          "description": "to_delayed_action is set to 400ms in karabiner.json",
          "to_delayed_action": {
            "to_if_invoked": [
              {
                "set_variable": {
                  "name": "key pressed",
                  "value": 0
                }
              }
            ],
            "to_if_canceled": [
              {
                "set_variable": {
                  "name": "key pressed",
                  "value": 0
                }
              }
            ]
          }
        }
      ]
    }
  ]
}
