From 5f66bffb829562d3cc7fa1afe156ad109cd5424b Mon Sep 17 00:00:00 2001 From: Blake Romero Date: Sun, 12 Oct 2025 16:45:28 +0100 Subject: Add light theme & renamed active/inactive face --- modally.el | 65 +++++++++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 15 deletions(-) (limited to 'modally.el') diff --git a/modally.el b/modally.el index 679808a..084c5c4 100644 --- a/modally.el +++ b/modally.el @@ -231,26 +231,18 @@ modally-display-file-size modally-display-flymake modally-display-major-mode - " ") + " ") "Default modally format for the mode-line.") (setq-default mode-line-right-align-edge 'right-fringe) ;; HELPERS -(defun modally--set-face () +(defun modally-set-theme () "Set mode-line face." - (set-face-attribute - 'mode-line-active nil - :background "black" - :foreground "white" - :box `(:line-width (20 . 2) - :color ,(face-attribute 'modally-active :foreground))) - (set-face-attribute - 'mode-line-inactive nil - :background "black" - :foreground "grey" - :box `(:line-width (20 . 2) - :color ,(face-attribute 'modally-inactive :foreground)))) + (interactive) + (if (eq 'dark (frame-parameter nil 'background-mode)) + (modally-set-dark-theme) + (modally-set-light-theme))) (defun modally--reset-face() "Reset mode-line face." @@ -270,7 +262,7 @@ (setq-default mode-line-format modally-format-default) (with-eval-after-load 'keycast (setq-default keycast-mode-line-insert-after 'modally-display-buffer-name)) - (modally--set-face)) + (modally-set-theme)) ;; MODE ;;;###autoload @@ -284,5 +276,48 @@ (modally--set-mode-line) (modally--reset-mode-line))) +(defun modally-set-dark-theme() + "Modally dark mode theme." + (let ((fg "#ffffff") + (mg "#444444") + (dm "#222222") + (bg "#000000")) + (set-face-attribute 'modally-separator-active nil :foreground mg) + (set-face-attribute 'modally-separator-inactive nil :foreground dm) + (set-face-attribute 'vertical-border nil :foreground mg) +(set-face-attribute + 'mode-line-active nil + :foreground fg + :background bg + :box `(:line-width (20 . 2) :color ,mg)) + (set-face-attribute + 'mode-line-inactive nil + :foreground dm + :background bg + :box `(:line-width (20 . 2) :color ,dm)))) + +(defun modally-set-light-theme() + "Modally dark mode theme." + (let ((fg "#000000") + (mg "#dddddd") + (dm "#ffffff") + (bg "#eeeeee")) + (set-face-attribute 'modally-separator-active nil :foreground mg) + (set-face-attribute 'modally-separator-inactive nil :foreground bg) + (set-face-attribute 'vertical-border nil :foreground mg) + (set-face-attribute + 'mode-line-active nil + :foreground fg + :background dm + :box `(:line-width (20 . 2) :color ,mg)) + (set-face-attribute + 'mode-line-inactive nil + :foreground mg + :background dm + :box `(:line-width (20 . 2) :color ,bg)))) + +;; Theme update on toggle +(advice-add 'modus-themes-toggle :after 'modally-set-theme) + (provide 'modally) ;;; modally.el ends here -- cgit