zachcurry / emacs-anywhere

Configurable automation + hooks called with application information
MIT License
1.08k stars 49 forks source link

Is it possible to configure emacs-anywhere with Karabiner-elements instead of setting a hotkey via the GUI SystemPreferences/keyboard/shortcuts/services/general? #79

Open pdelfino opened 2 years ago

pdelfino commented 2 years ago

Hi,

I really like this emacs-anywhere software!

Currently, I am following the instructions on the README file. Hence, I have defined a hotkey via macOS' GUI on SystemPreferences/keyboard/shortcut/services/general.

However, I am managing all my hotkeys with Karabiner-elements. I like the text-driven approach via JSON file. This is my config file. It is way more reproducible.

If I re-store this machine (or buy a new one) or share my config with a friend, it is just necessary to paste the text content.

Thus, I would like to ask, is it possible to configure this with a shell command?

For instance, this is how I can open Brave browser:

{
    "description": "left_command + b -> Brave",
    "manipulators": [
        {
            "from": {
                "key_code": "b",
                "modifiers": {
                    "mandatory": [
                        "left_command"
                    ]
                }
            },
            "to": [
                {
                    "shell_command": "open '/Applications/Brave Browser.app'"
                }
            ],
            "type": "basic"
        }
    ]
}

What would be the terminal shell command to invoke Emacs-anywhere on macOS? What command is trigger when I execute the shortcut defined on Apple's GUI System Preferences?

Thanks