From 87ac58c08aa71d6b4bb3fe5c0d5079018c476da6 Mon Sep 17 00:00:00 2001 From: "Thomas F. K. Jorna" Date: Fri, 6 Aug 2021 03:32:01 +0200 Subject: feature: custom browser --- org-roam-ui.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'org-roam-ui.el') 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 -- cgit v1.2.3