0

I cannot correctly add this KarabinerElements O-launcher config to my config file because of a constant error: End of file expected.json

error in line 3 and 10

[
{
{
    "conditions": [
        {
            "name": "launcher_mode_v4",
            "type": "variable_if",
            "value": 1
        }
    ],
    "from": {
        "key_code": "n",
        "modifiers": {
            "mandatory": []
        }
    },
    "to": [
        {
            "shell_command": "open -a 'notion.app'"
        }
    ],
    "type": "basic"
},
{
    "from": {
        "modifiers": {
            "mandatory": []
        },
        "simultaneous": [
            {
                "key_code": "o"
            },
            {
                "key_code": "n"
            }
        ],
        "simultaneous_options": {
            "key_down_order": "strict",
            "key_up_order": "strict_inverse",
            "to_after_key_up": [
                {
                    "set_variable": {
                        "name": "launcher_mode_v4",
                        "value": 0
                    }
                }
            ]
        }
    },
    "parameters": {
        "basic.simultaneous_threshold_milliseconds": 500
    },
    "to": [
        {
            "set_variable": {
                "name": "launcher_mode_v4",
                "value": 1
            }
        },
        {
            "shell_command": "open -a 'notion.app'"
        }
    ],
    "type": "basic"
},
}
]

I've tried encapsulating it in squared brackets, among other solutions.

I'm trying to paste it between those two 'configs'

{
            "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": [
                    {
                        "manipulators": [
                            {
                                "description": "Change caps_lock to command+control+option+shift.",
                                "from": {
                                    "key_code": "caps_lock",
                                    "modifiers": {
                                        "optional": [
                                            "any"
                                        ]
                                    }
                                },
                                "to": [
                                    {
                                        "key_code": "left_shift",
                                        "modifiers": [
                                            "left_command",
                                            "left_control",
                                            "left_option"
                                        ]
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "rules": []
                            }
                        ]
                    },
                    {
                        "description": "o Launcher",
                        "manipulators": [
                            {
                                "conditions": [
                                    {
                                        "name": "launcher_mode_v4",
                                        "type": "variable_if",
                                        "value": 1
                                    }
                                ],
                                "from": {
                                    "key_code": "0",
                                    "modifiers": {
                                        "mandatory": []
                                    }
                                },
                                "to": [
                                    {
                                        "shell_command": "open -a 'Obsidian.app'"
                                    }
                                ],
                                "type": "basic"
                            },
                            {
                                "from": {
                                    "modifiers": {
                                        "mandatory": []
                                    },
                                    "simultaneous": [
                                        {
                                            "key_code": "o"
                                        },
                                        {
                                            "key_code": "0"
                                        }
                                    ],
                                    "simultaneous_options": {
                                        "key_down_order": "strict",
                                        "key_up_order": "strict_inverse",
                                        "to_after_key_up": [
                                            {
                                                "set_variable": {
                                                    "name": "launcher_mode_v4",
                                                    "value": 0
                                                }
                                            }
                                        ]
                                    }
                                },
                                "parameters": {
                                    "basic.simultaneous_threshold_milliseconds": 500
                                },
                                "to": [
                                    {
                                        "set_variable": {
                                            "name": "launcher_mode_v4",
                                            "value": 1
                                        }
                                    },
                                    {
                                        "shell_command": "open -a 'Obsidian.app'"
                                    }
                                ],
                                "type": "basic"
                            },

Not sure what's wrong, I mean, JSON is strict with formatting...

Kamil
  • 27
  • 5

1 Answers1

0

I don't understand what you're trying to do, but this part is not valid JSON:

[
{
{

Inside an object (curly brackets), you need to have a key-value mapping, e.g.:

{ "a": "b" }
ZimbiX
  • 485
  • 3
  • 7