(docs): update org-protocol installation for MacOS (#225)

This commit is contained in:
Jethro Kuan
2020-03-05 11:51:28 +08:00
committed by GitHub
parent d96ae119ab
commit 1f02b0c5dd

View File

@@ -95,8 +95,7 @@ policy.
## Mac OS
One solution to this, recommended in [Issue
#115](https://github.com/jethrokuan/org-roam/issues/115), is to use
One solution is to use
[Platypus](https://github.com/sveinbjornt/Platypus). Here are the
instructions for setting up with Platypus and Chrome:
@@ -105,17 +104,24 @@ instructions for setting up with Platypus and Chrome:
```sh
brew cask install playtpus
```
2. Create a script `launch_emacs.sh`:
2. Platypus settings:
```
#!/usr/bin/env bash
/usr/local/bin/emacsclient --no-wait $1
```
2. Create a Platypus app with the following settings:
| Setting | Value |
|--------------------------------+---------------------------|
| App Name | "OrgProtocol" |
| Script Type | "env" · "/usr/bin/env" |
| Script Path | "path/to/launch-emacs.sh" |
| Interface | None |
| Accept dropped items | true |
| Remain running after execution | false |
- App Name: `OrgProtocol`
- Script Type: `env` and `/usr/bin/env`
- Script Path: `/path/to/emacsclient $1`
- Tick Accept dropped items and click Settings
- Tick Accept dropped files
- Tick Register as URI scheme handler
- Add `org-protocol` as a protocol
- Create the app
To disable the "confirm" prompt in Chrome, you can also make Chrome
show a checkbox to tick, so that the `OrgProtocol` app will be used
@@ -125,4 +131,20 @@ without confirmation. To do this, run in a shell:
defaults write com.google.Chrome ExternalProtocolDialogShowAlwaysOpenCheckbox -bool true
```
##### Note for Emacs Mac Port
If you're using [Emacs Mac Port](https://github.com/railwaycat/homebrew-emacsmacport), it
registered its `Emacs.app` as the default handler for the URL scheme
`org-protocol`. We have to make our `OrgProtocol.app` the default
handler instead (replace `org.yourusername.OrgProtocol` with your app
identifier):
```
$ defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
'{"LSHandlerPreferredVersions" = { "LSHandlerRoleAll" = "-"; }; LSHandlerRoleAll = "org.yourusername.OrgProtocol"; LSHandlerURLScheme = "org-protocol";}'
```
Then restart your computer.
[org-protocol-inst]: https://orgmode.org/worg/org-contrib/org-protocol.html