summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md37
-rw-r--r--org-roam-ui.el7
2 files changed, 36 insertions, 8 deletions
diff --git a/README.md b/README.md
index de5f62b..281d371 100644
--- a/README.md
+++ b/README.md
@@ -53,9 +53,16 @@ Then something along the following to your `config.el`
(use-package! org-roam-ui
:after org-roam ;; or :after org
- :hook (org-roam . org-roam-ui-mode)
+ :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)
:config
-)
+ (setq org-roam-ui-sync-theme t
+ org-roam-ui-follow t
+ org-roam-ui-update-on-save t
+ org-roam-ui-open-on-start t))
```
@@ -68,11 +75,18 @@ 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 (org-roam . org-roam-ui-mode))
-```
+ :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)
+ :config
+ (setq org-roam-ui-sync-theme t
+ org-roam-ui-follow t
+ org-roam-ui-update-on-save t
+ org-roam-ui-open-on-start t))
-TODO
-You probably know how to do this
+```
## Usage
@@ -142,8 +156,7 @@ You can also provide your own theme if you do not like syncing nor like the defa
```emacs-lisp
(setq org-roam-ui-custom-theme
- (list
- (bg . "#1E2029")
+ '((bg . "#1E2029")
(bg-alt . "#282a36")
(fg . "#f8f8f2")
(fg-alt . "#6272a4")
@@ -159,6 +172,14 @@ You can also provide your own theme if you do not like syncing nor like the defa
You can optionally provide `(base1 . "#XXXXXX")` arguments after the last one to also set the background shades, otherwise ORUI will guess based on the provides bg and fg.
+### 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)
+```
+
## Disclaimers ‼
- We only support [org-roam v2](https://blog.jethro.dev/posts/org_roam_v2/); v1 will never be supported.
diff --git a/org-roam-ui.el b/org-roam-ui.el
index aae4446..e122d74 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