From 0eccdd32a3944b312ae6031c979f2bfcf6546d54 Mon Sep 17 00:00:00 2001 From: BardofSprites <89086143+BardofSprites@users.noreply.github.com> Date: Mon, 9 Dec 2024 21:36:14 -0500 Subject: ryo-modal with modeline and cursor --- bard-elisp/bard-theme.el | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'bard-elisp/bard-theme.el') diff --git a/bard-elisp/bard-theme.el b/bard-elisp/bard-theme.el index 1d37ffb..fcc8a16 100644 --- a/bard-elisp/bard-theme.el +++ b/bard-elisp/bard-theme.el @@ -77,7 +77,8 @@ (dolist (hook '(bard/after-theme-load-hook)) (add-hook hook #'fontaine-apply-current-preset) - (add-hook hook #'logos-update-fringe-in-buffers)) + (add-hook hook #'logos-update-fringe-in-buffers) + (add-hook hook #'bard/update-ryo-cursor-color)) (defun bard/select-theme (&optional theme) "Enable the specified THEME, or prompt the user to select one if THEME is nil." @@ -96,4 +97,23 @@ (message "Loaded the %s theme" colored-theme-name) (run-hooks 'bard/after-theme-load-hook))) +(defun bard/update-ryo-cursor-color () + "Update the color variable of `ryo-modal-mode' cursor to match the ef/modus theme." + (let ((active-theme (car custom-enabled-themes)) + (cursor-color nil)) + (cond + ((and (fboundp 'ef-themes-with-colors) + (string-prefix-p "ef-" (symbol-name active-theme))) + (ef-themes-with-colors + (setq ryo-modal-cursor-color cursor + ryo-modal-default-cursor-color cursor))) + ((and (fboundp 'modus-themes-with-colors) + (string-prefix-p "modus-" (symbol-name active-theme))) + (modus-themes-with-colors + (setq ryo-modal-cursor-color cursor + ryo-modal-default-cursor-color cursor))) + (t (setq cursor-color "red")) + (setq ryo-modal-cursor-color cursor-color + ryo-modal-default-cursor-color cursor-color)))) + (provide 'bard-theme) -- cgit v1.2.3