Skip to content

Latest commit

 

History

History
94 lines (76 loc) · 3.08 KB

README.md

File metadata and controls

94 lines (76 loc) · 3.08 KB

Hotkys

Web site and RayCast extension that allows you to find shortcuts for your app.

RayCast extension adds additional automation features:

  1. Find shortcuts for the frontmost application
  2. Run shortcuts by selecting from the list
  3. Copy bundle id for the frontmost application

Shortcuts Contribution

Shortcuts are stored as a json files in shortcuts-disco-site/shortcuts-data. GitHub link.

Interfaces for input model can be found by this link.

To add new application create a json file in shortcuts-disco-site/shortcuts-data with following template:

{
  "$schema": "schema/shortcut.schema.json"
}

Schema will help with json structure. It doesn't provide all the validation, but dramatically simplifies the whole process.

Each application is described by name, slug and optional bundleId of the macOS application.

  • App contains keymaps
  • Keymap contain title and list of sections
  • Section contains title and list of shortcuts
  • Shortcut contain title, comment and shortcut declaration inside key property. There should be at least key or comment field. Key contains structured shortcut declaration while comment is just a string value.

Shortcuts key rules:

  • Key consist of modifiers plus base key separated by + sign.
  • Supported modifiers: ctrl, shift, opt, cmd. Modifiers should be specified in that exact order, lowercase {@link modifierTokens}.
  • Final shortcut token should always be a base key. List of all base keys: {@link public/data/key-codes.json}.
  • Examples: ctrl+s, shift+cmd+e.
  • Shortcut macro or sequences of shortcuts are also supported and should be separated by space ( ).
  • Example: cmd+k cmd+s (first press Cmd+K and then Cmd+S)
Basic example of shortcuts for Safari
{
  "$schema": "schema/shortcut.schema.json",
  "bundleId": "com.apple.Safari",
  "name": "Safari",
  "keymaps": [
    {
      "title": "Default",
      "sections": [
        {
          "title": "Bookmarks",
          "shortcuts": [
            {
              "title": "Open Bookmarks Manager",
              "key": "opt+cmd+b"
            }
          ]
        },
        {
          "title": "Current Webpage",
          "shortcuts": [
            {
              "title": "Search the current webpage",
              "key": "cmd+f"
            },
            {
              "title": "Print the current webpage",
              "key": "cmd+p"
            }
          ]
        }
      ]
    }
  ]
}

Additional information

Use prettify script to format json files and fix order of key modifiers.

Go to shortcuts-disco-site folder and run:

npm run prettify