summaryrefslogtreecommitdiff
path: root/org-roam-ui.el
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-08-06 03:32:01 +0200
committerThomas F. K. Jorna <[email protected]>2021-08-06 03:32:01 +0200
commit87ac58c08aa71d6b4bb3fe5c0d5079018c476da6 (patch)
tree85707cc4f40948a5f877985f916c503926b0be59 /org-roam-ui.el
parent3414fee4a29a797841155a4cd89d368bccba82c8 (diff)
feature: custom browser
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r--org-roam-ui.el11
1 files changed, 9 insertions, 2 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index 9cf6a37..3ba3e21 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -107,6 +107,13 @@ This can lead to some jank."
:group 'org-roam-ui
:type 'boolean)
+(defcustom org-roam-ui-browser-function #'browse-url
+ "When non-nil launch org-roam-ui with a different browser function.
+Takes a function name, such as #'browse-url-chromium.
+Defaults to #'browse-url."
+ :group 'org-roam-ui
+ :type 'function)
+
(defvar org-roam-ui--ws-current-node nil
"Var to keep track of which node you are looking at.")
(defvar oru-ws nil
@@ -126,14 +133,14 @@ This serves the web-build and API over HTTP."
(message "You are running org-roam %s. Org-roam-ui is only compatible with v2, please upgrade." (org-roam-version))
(setq org-roam-ui-mode -1))
(message "Org-roam is either not installed or not running. Please fix this.")
- (setq org-roam-ui-mode -1)))
+ (setq org-roam-ui-mode -1))
(cond
(org-roam-ui-mode
(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"))
+ (funcall org-roam-ui-browser-function "http://localhost:35901"))
(setq org-roam-ui-ws
(websocket-server
35903