to.shell_command

shell_command executes the shell command.

Examples

Open application

{
    "description": "Open Safari by right_command+s",
    "manipulators": [
        {
            "type": "basic",
            "from": {
                "key_code": "s",
                "modifiers": {
                    "mandatory": ["right_command"],
                    "optional": ["caps_lock"]
                }
            },
            "to": [{ "shell_command": "open -a 'Safari.app'" }]
        }
    ]
}

Execute shell from file

{
    "description": "Execute hello.sh by right_command+s",
    "manipulators": [
        {
            "type": "basic",
            "from": {
                "key_code": "s",
                "modifiers": {
                    "mandatory": ["right_command"],
                    "optional": ["caps_lock"]
                }
            },
            "to": [{ "shell_command": "/bin/sh ~/opt/shell_commands/hello.sh" }]
        }
    ]
}