What is the coding to program my F1 key to launch the Safari application using Karabiner?

2 Answers 2


Modify private.xml and add:

   <name>F1 Safari</name>
   <autogen>__KeyToKey__ KeyCode::F1, KeyCode::VK_OPEN_URL_APP_Safari</autogen>

Then enable it in Change Key. Depending on your settings (Consumer Keys or F1-F12 for the F-keys) in System Preferences -> Keyboard -> Keyboard -> F-key behavior you may have to hit the fn-key also.


In Karabiner Elements, add a complex modification rule to /Users/username/.config/karabiner/karabiner.json:

  "description": "Launch Safari (F1)",
  "manipulators": [
      "from": {
        "key_code": "f1"
      "to": [
          "shell_command": "open -a '/Applications/Safari.app'"
      "type": "basic"

Then Add Rule and pick this one from the list.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .