mirror of
https://github.com/org-roam/org-roam
synced 2025-08-19 13:43:31 -05:00
198 lines
8.3 KiB
HTML
198 lines
8.3 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<!-- Copyright (C) 2020-2020 Jethro Kuan <jethrokuan95@gmail.com>
|
|
|
|
You can redistribute this document and/or modify it under the terms
|
|
of the GNU General Public License as published by the Free Software
|
|
Foundation, either version 3 of the License, or (at your option) any
|
|
later version.
|
|
|
|
This document is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
General Public License for more details.
|
|
-->
|
|
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Installation (1) (Org-roam User Manual)</title>
|
|
|
|
<meta name="description" content="Installation (1) (Org-roam User Manual)">
|
|
<meta name="keywords" content="Installation (1) (Org-roam User Manual)">
|
|
<meta name="resource-type" content="document">
|
|
<meta name="distribution" content="global">
|
|
<meta name="Generator" content="makeinfo">
|
|
<link href="index.html#Top" rel="start" title="Top">
|
|
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
|
|
<link href="Roam-Protocol.html#Roam-Protocol" rel="up" title="Roam Protocol">
|
|
<link href="The-roam_002dfile-protocol.html#The-roam_002dfile-protocol" rel="next" title="The roam-file protocol">
|
|
<link href="_005f.html#g_t_005f" rel="prev" title="_">
|
|
<style type="text/css">
|
|
<!--
|
|
a.summary-letter {text-decoration: none}
|
|
blockquote.indentedblock {margin-right: 0em}
|
|
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
|
|
blockquote.smallquotation {font-size: smaller}
|
|
div.display {margin-left: 3.2em}
|
|
div.example {margin-left: 3.2em}
|
|
div.lisp {margin-left: 3.2em}
|
|
div.smalldisplay {margin-left: 3.2em}
|
|
div.smallexample {margin-left: 3.2em}
|
|
div.smalllisp {margin-left: 3.2em}
|
|
kbd {font-style: oblique}
|
|
pre.display {font-family: inherit}
|
|
pre.format {font-family: inherit}
|
|
pre.menu-comment {font-family: serif}
|
|
pre.menu-preformatted {font-family: serif}
|
|
pre.smalldisplay {font-family: inherit; font-size: smaller}
|
|
pre.smallexample {font-size: smaller}
|
|
pre.smallformat {font-family: inherit; font-size: smaller}
|
|
pre.smalllisp {font-size: smaller}
|
|
span.nolinebreak {white-space: nowrap}
|
|
span.roman {font-family: initial; font-weight: normal}
|
|
span.sansserif {font-family: sans-serif; font-weight: normal}
|
|
ul.no-bullet {list-style: none}
|
|
-->
|
|
</style>
|
|
<link rel="stylesheet" type="text/css" href="assets/page.css">
|
|
|
|
|
|
</head>
|
|
|
|
<body lang="en">
|
|
<a name="Installation-_00281_0029"></a>
|
|
<div class="header">
|
|
<p>
|
|
Next: <a href="The-roam_002dfile-protocol.html#The-roam_002dfile-protocol" accesskey="n" rel="next">The ‘<samp>roam-file</samp>’ protocol</a>, Previous: <a href="_005f.html#g_t_005f" accesskey="p" rel="prev">_</a>, Up: <a href="Roam-Protocol.html#Roam-Protocol" accesskey="u" rel="up">Roam Protocol</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
|
|
</div>
|
|
<hr>
|
|
<a name="Installation-2"></a>
|
|
<h3 class="section">12.2 Installation</h3>
|
|
|
|
<p>To enable Org-roam’s protocol extensions, you have to add the following to your init file:
|
|
</p>
|
|
<div class="lisp">
|
|
<pre class="lisp">(require 'org-roam-protocol)
|
|
</pre></div>
|
|
|
|
<p>The instructions for setting up ‘<samp>org-protocol=</samp>’ are reproduced below.
|
|
</p>
|
|
<p>We will also need to create a desktop application for ‘<samp>emacsclient</samp>’. The
|
|
instructions for various platforms are shown below.
|
|
</p>
|
|
<p>For Linux users, create a desktop application in ‘<samp>~/.local/share/applications/org-protocol.desktop</samp>’:
|
|
</p>
|
|
<div class="example">
|
|
<pre class="example">[Desktop Entry]
|
|
Name=Org-Protocol
|
|
Exec=emacsclient %u
|
|
Icon=emacs-icon
|
|
Type=Application
|
|
Terminal=false
|
|
MimeType=x-scheme-handler/org-protocol
|
|
</pre></div>
|
|
|
|
<p>Associate ‘<samp>org-protocol://</samp>’ links with the desktop application by
|
|
running in your shell:
|
|
</p>
|
|
<div class="example">
|
|
<pre class="example">xdg-mime default org-protocol.desktop x-scheme-handler/org-protocol
|
|
</pre></div>
|
|
|
|
<p>To disable the “confirm” prompt in Chrome, you can also make Chrome
|
|
show a checkbox to tick, so that the ‘<samp>Org-Protocol Client</samp>’ app will be used
|
|
without confirmation. To do this, run in a shell:
|
|
</p>
|
|
<div class="example">
|
|
<pre class="example">sudo mkdir -p /etc/opt/chrome/policies/managed/
|
|
sudo tee /etc/opt/chrome/policies/managed/external_protocol_dialog.json >/dev/null <<'EOF'
|
|
{
|
|
"ExternalProtocolDialogShowAlwaysOpenCheckbox": true
|
|
}
|
|
EOF
|
|
sudo chmod 644 /etc/opt/chrome/policies/managed/external_protocol_dialog.json
|
|
</pre></div>
|
|
|
|
<p>and then restart Chrome (for example, by navigating to <chrome://restart>) to
|
|
make the new policy take effect.
|
|
</p>
|
|
<p>See <a href="https://www.chromium.org/administrators/linux-quick-start">here</a> for more info on the ‘<samp>/etc/opt/chrome/policies/managed</samp>’ directory and
|
|
<a href="https://cloud.google.com/docs/chrome-enterprise/policies/?policy=ExternalProtocolDialogShowAlwaysOpenCheckbox">here</a> for information on the ‘<samp>ExternalProtocolDialogShowAlwaysOpenCheckbox</samp>’ policy.
|
|
</p>
|
|
<p>For MacOS, one solution is to use <a href="https://github.com/sveinbjornt/Platypus">Platypus</a>. Here are the instructions for
|
|
setting up with Platypus and Chrome:
|
|
</p>
|
|
<ol>
|
|
<li> Install and launch Platypus (with <a href="https://brew.sh/">Homebrew</a>):
|
|
</li></ol>
|
|
|
|
<div class="example">
|
|
<pre class="example">brew cask install platypus
|
|
</pre></div>
|
|
|
|
<ol>
|
|
<li> Create a script ‘<samp>launch_emacs.sh</samp>’:
|
|
</li></ol>
|
|
|
|
<div class="example">
|
|
<pre class="example">#!/usr/bin/env bash
|
|
/usr/local/bin/emacsclient --no-wait $1
|
|
</pre></div>
|
|
|
|
<ol>
|
|
<li> Create a Platypus app with the following settings:
|
|
</li></ol>
|
|
|
|
<div class="example">
|
|
<pre class="example">| 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 |
|
|
</pre></div>
|
|
|
|
|
|
<p>Inside ‘<samp>Settings</samp>’:
|
|
</p>
|
|
<div class="example">
|
|
<pre class="example">| Setting | Value |
|
|
|--------------------------------+----------------|
|
|
| Accept dropped files | true |
|
|
| Register as URI scheme handler | true |
|
|
| Protocol | "org-protocol" |
|
|
</pre></div>
|
|
|
|
<p>To disable the “confirm” prompt in Chrome, you can also make Chrome
|
|
show a checkbox to tick, so that the ‘<samp>OrgProtocol</samp>’ app will be used
|
|
without confirmation. To do this, run in a shell:
|
|
</p>
|
|
<div class="example">
|
|
<pre class="example">defaults write com.google.Chrome ExternalProtocolDialogShowAlwaysOpenCheckbox -bool true
|
|
</pre></div>
|
|
|
|
|
|
<p>If you’re using <a href="https://github.com/railwaycat/homebrew-emacsmacport">Emacs Mac Port</a>, it registered its ‘Emacs.app‘ as the default
|
|
handler for the URL scheme ‘org-protocol‘. To make ‘<samp>OrgProtocol.app</samp>’
|
|
the default handler instead, run:
|
|
</p>
|
|
<div class="example">
|
|
<pre class="example">defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandlers -array-add \
|
|
'{"LSHandlerPreferredVersions" = { "LSHandlerRoleAll" = "-"; }; LSHandlerRoleAll = "org.yourusername.OrgProtocol"; LSHandlerURLScheme = "org-protocol";}'
|
|
</pre></div>
|
|
|
|
<p>Then restart your computer.
|
|
</p>
|
|
<hr>
|
|
<div class="header">
|
|
<p>
|
|
Next: <a href="The-roam_002dfile-protocol.html#The-roam_002dfile-protocol" accesskey="n" rel="next">The ‘<samp>roam-file</samp>’ protocol</a>, Previous: <a href="_005f.html#g_t_005f" accesskey="p" rel="prev">_</a>, Up: <a href="Roam-Protocol.html#Roam-Protocol" accesskey="u" rel="up">Roam Protocol</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|