Skip to main content

Karabiner-Elements can be used to run an open shell command. It'll open it if the application is closed, and focus if it's already open. Example jsonIf you create cmd-numbers.json in "complex_modifications"~/.config/karabiner/assets/complex_modifications/, you'll see new rules in Karabiner under Complex modifications | Add rule:

                        {
                            "description": "Finder",
                            "from": {
                                "key_code": "1",
                                "modifiers": {
                                    "mandatory": "command"
                                }
                            },
                            "to": {
                                "repeat": false,
                                "shell_command": "open -b com.apple.finder"
                            },
                            "type": "basic"
                        },
{
  "title": "Launch apps with Cmd+<number>",
  "rules": [
    {
      "description": "Finder",
      "manipulators": [
        {
          "from": {
            "key_code": "1",
            "modifiers": {
              "mandatory": "command"
            }
          },
          "to": {
            "repeat": false,
            "shell_command": "open -b com.apple.finder"
          },
          "type": "basic"
        }
      ]
    },
    {
      "description": "Firefox",
      "manipulators": [
        {
          "from": {
            "key_code": "2",
            "modifiers": {
              "mandatory": "command"
            }
          },
          "to": {
            "repeat": false,
            "shell_command": "open -a Firefox"
          },
          "type": "basic"
        }
      ]
    }
  ]
}

Karabiner-Elements can be used to run an open shell command. It'll open it if the application is closed, and focus if it's already open. Example json in "complex_modifications"

                        {
                            "description": "Finder",
                            "from": {
                                "key_code": "1",
                                "modifiers": {
                                    "mandatory": "command"
                                }
                            },
                            "to": {
                                "repeat": false,
                                "shell_command": "open -b com.apple.finder"
                            },
                            "type": "basic"
                        },

Karabiner-Elements can be used to run an open shell command. It'll open it if the application is closed, and focus if it's already open. If you create cmd-numbers.json in ~/.config/karabiner/assets/complex_modifications/, you'll see new rules in Karabiner under Complex modifications | Add rule:

{
  "title": "Launch apps with Cmd+<number>",
  "rules": [
    {
      "description": "Finder",
      "manipulators": [
        {
          "from": {
            "key_code": "1",
            "modifiers": {
              "mandatory": "command"
            }
          },
          "to": {
            "repeat": false,
            "shell_command": "open -b com.apple.finder"
          },
          "type": "basic"
        }
      ]
    },
    {
      "description": "Firefox",
      "manipulators": [
        {
          "from": {
            "key_code": "2",
            "modifiers": {
              "mandatory": "command"
            }
          },
          "to": {
            "repeat": false,
            "shell_command": "open -a Firefox"
          },
          "type": "basic"
        }
      ]
    }
  ]
}
added 76 characters in body
Source Link

Karabiner-Elements can be used to run an open shell command. It'll open it if the application is closed, and focus if it's already open. Example json in "complex_modifications"

                        {
                            "description": "Finder",
                            "from": {
                                "key_code": "1",
                                "modifiers": {
                                    "mandatory": "command"
                                }
                            },
                            "to": {
                                "repeat": false,
                                "shell_command": "open -b com.apple.finder"
                            },
                            "type": "basic"
                        },

The -b flag means bundle ID. You can also use open -a Finder.app.

Karabiner-Elements can be used to run an open shell command. Example json in "complex_modifications"

                        {
                            "description": "Finder",
                            "from": {
                                "key_code": "1",
                                "modifiers": {
                                    "mandatory": "command"
                                }
                            },
                            "to": {
                                "repeat": false,
                                "shell_command": "open -b com.apple.finder"
                            },
                            "type": "basic"
                        },

The -b flag means bundle ID. You can also use open -a Finder.app.

Karabiner-Elements can be used to run an open shell command. It'll open it if the application is closed, and focus if it's already open. Example json in "complex_modifications"

                        {
                            "description": "Finder",
                            "from": {
                                "key_code": "1",
                                "modifiers": {
                                    "mandatory": "command"
                                }
                            },
                            "to": {
                                "repeat": false,
                                "shell_command": "open -b com.apple.finder"
                            },
                            "type": "basic"
                        },

The -b flag means bundle ID. You can also use open -a Finder.app.

Source Link

Karabiner-Elements can be used to run an open shell command. Example json in "complex_modifications"

                        {
                            "description": "Finder",
                            "from": {
                                "key_code": "1",
                                "modifiers": {
                                    "mandatory": "command"
                                }
                            },
                            "to": {
                                "repeat": false,
                                "shell_command": "open -b com.apple.finder"
                            },
                            "type": "basic"
                        },

The -b flag means bundle ID. You can also use open -a Finder.app.