summaryrefslogtreecommitdiff
path: root/org-roam-ui.el
diff options
context:
space:
mode:
authorThomas F. K. Jorna <[email protected]>2021-07-28 17:57:04 +0200
committerThomas F. K. Jorna <[email protected]>2021-07-28 17:57:04 +0200
commitf9aac2c130dbec61c9466ae4b932aa9b4158d309 (patch)
tree8ea38cca9d5e966955194b650274d3b61416a219 /org-roam-ui.el
parent173963d752bc8ea9c18d4165c0bcf88097c69cbe (diff)
added some more tweaks
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r--org-roam-ui.el36
1 files changed, 18 insertions, 18 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index c218aee..12a1623 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -105,20 +105,20 @@ This serves the web-build and API over HTTP."
(websocket-server
35903
:host 'local
- :on-open (lambda (ws) (progn (setq oru-ws ws) (org-roam-ui--send-graphdata) (message "Connection established with org-roam-ui")))
+ :on-open (lambda (ws) (progn (setq oru-ws ws) (org-roam-ui--send-graphdata) (org-roam-ui-sync-theme--advice) (message "Connection established with org-roam-ui")))
:on-close (lambda (_websocket) (setq oru-ws nil) (message "Connection with org-roam-ui closed succesfully."))))
- (if (boundp 'counsel-load-theme
+ (if (boundp 'counsel-load-theme)
(advice-add 'counsel-load-theme :after #'org-roam-ui-sync-theme--advice)
- (advice-add 'load-theme :after #'org-roam-ui-sync-theme-manually)))
+ (advice-add 'load-theme :after #'org-roam-ui-sync-theme-manually))
(add-hook 'post-command-hook #'org-roam-ui--update-current-node)
(add-hook 'post-command-hook #'org-roam-ui-update))
(t
(progn
(remove-hook 'post-command-hook #'org-roam-ui-update)
(remove-hook 'post-command-hook #'org-roam-ui--update-current-node)
- (if (boundp 'counsel-load-theme
+ (if (boundp 'counsel-load-theme)
(advice-remove 'counsel-load-theme #'org-roam-ui-sync-theme--advice)
- (advice-remove 'load-theme #'org-roam-ui-sync-theme--advice)))
+ (advice-remove 'load-theme #'org-roam-ui-sync-theme--advice))
(websocket-server-close org-roam-ui-ws)
(delete-process org-roam-ui-ws)
(httpd-stop)))))
@@ -240,19 +240,19 @@ This function is added to `post-command-hook'."
))
-(defservlet* theme text/stream ()
- (progn)
- (if org-roam-ui-sync-theme
- (if (boundp 'doom-themes--colors)
- (let*
- ((colors (butlast doom-themes--colors (- (length doom-themes--colors) 25))) ui-theme (list nil))
- (progn
- (dolist (color colors) (push (cons (car color) (car (cdr color))) ui-theme))
- ui-theme)))))
- (insert (format "data: %s\n\n" (json-encode (org-roam-ui-get-theme)))))
- (when org-roam-ui-custom-theme
- (insert (format "data %s\n\n" (json-encode org-roam-ui-custom-theme)))))
- (httpd-send-header t "text/event-stream" 200 :Access-Control-Allow-Origin "*"))
+;; (defservlet* theme text/stream ()
+;; (progn)
+;; (if org-roam-ui-sync-theme
+;; (if (boundp 'doom-themes--colors)
+;; (let*
+;; ((colors (butlast doom-themes--colors (- (length doom-themes--colors) 25))) ui-theme (list nil))
+;; (progn
+;; (dolist (color colors) (push (cons (car color) (car (cdr color))) ui-theme))
+;; ui-theme))
+;; (insert (format "data: %s\n\n" (json-encode (org-roam-ui-get-theme)))))
+;; (when org-roam-ui-custom-theme
+;; (insert (format "data %s\n\n" (json-encode org-roam-ui-custom-theme)))))
+;; (httpd-send-header t "text/event-stream" 200 :Access-Control-Allow-Origin "*"))
(provide 'org-roam-ui)
;;; org-roam-ui.el ends here