summaryrefslogtreecommitdiff
path: root/modally.el
diff options
context:
space:
mode:
authorBlake Romero <blake@developercraft.com>2025-10-12 16:45:28 +0100
committerBlake Romero <blake@developercraft.com>2025-10-12 16:45:28 +0100
commit5f66bffb829562d3cc7fa1afe156ad109cd5424b (patch)
treea5b1ee25c427990c3fa4f9b206adca1c527a622c /modally.el
parent5394c2302dd75216e3c7ad2538e08c33b7e96d63 (diff)
Add light theme & renamed active/inactive face
Diffstat (limited to 'modally.el')
-rw-r--r--modally.el65
1 files changed, 50 insertions, 15 deletions
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