summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md10
-rw-r--r--org-roam-ui.el7
2 files changed, 12 insertions, 5 deletions
diff --git a/README.md b/README.md
index 5cc61b4..281d371 100644
--- a/README.md
+++ b/README.md
@@ -53,8 +53,8 @@ Then something along the following to your `config.el`
(use-package! org-roam-ui
:after org-roam ;; or :after org
- :hook
-;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
+ :hook
+;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;; a hookable mode anymore, you're advised to pick something yourself
;; if you don't care about startup time, use
;; :hook (after-init . org-roam-ui-mode)
@@ -75,8 +75,8 @@ We recommend only loading org-roam-ui after loading org(-roam) as starting the s
:straight
(:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out"))
:after org-roam
- :hook
-;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
+ :hook
+;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have
;; a hookable mode anymore, you're advised to pick something yourself
;; if you don't care about startup time, use
;; :hook (after-init . org-roam-ui-mode)
@@ -88,7 +88,6 @@ We recommend only loading org-roam-ui after loading org(-roam) as starting the s
```
-
## Usage
Use `M-x org-roam-ui-mode RET` to enable the global mode.
@@ -176,6 +175,7 @@ You can optionally provide `(base1 . "#XXXXXX")` arguments after the last one to
### Open on start
By default, org-roam-ui will try to open itself in your default browser. To disable this, set
+
```emacs-lisp
(setq org-roam-ui-open-on-start nil)
```
diff --git a/org-roam-ui.el b/org-roam-ui.el
index aca7e40..17952c8 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -97,6 +97,11 @@ This can lead to some jank."
:group 'org-roam-ui
:type 'boolean)
+(defcustom org-roam-ui-open-on-start t
+ "Whether to open your default browser when org-roam-ui-mode launces."
+ :group 'org-roam-ui
+ :type 'boolean)
+
(defvar org-roam-ui--ws-current-node nil
"Var to keep track of which node you are looking at.")
(defvar oru-ws nil
@@ -116,6 +121,8 @@ This serves the web-build and API over HTTP."
(setq-local httpd-port org-roam-ui-port)
(setq httpd-root org-roam-ui/app-build-dir)
(httpd-start)
+ (when org-roam-ui-open-on-start
+ (browse-url "http://localhost:35901"))
(setq org-roam-ui-ws
(websocket-server
35903