summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modally-faces.el16
-rw-r--r--modally.el65
2 files changed, 58 insertions, 23 deletions
diff --git a/modally-faces.el b/modally-faces.el
index d4eb33d..735cdcd 100644
--- a/modally-faces.el
+++ b/modally-faces.el
@@ -25,7 +25,7 @@
;; FACE
(defface modally-buffer
- '((t :inherit 'success))
+ '((t :inherit 'bold))
"A mode-line face used for the buffer name."
:group 'modally)
@@ -45,17 +45,17 @@
:group 'modally)
(defface modally-major-mode
- '((t :inherit 'mode-line-emphasis :bold nil))
+ '((t :inherit 'mode-line-emphasis))
"A mode-line face used for the major-mode."
:group 'modally)
(defface modally-git-branch
- '((t :foreground "#00bcff"))
+ '((t :inherit 'success))
"A mode-line face used for the Git branch name."
:group 'modally)
(defface modally-org-timer
- '((t :inherit 'success))
+ '((t :inherit 'org-todo))
"A mode-line face used for the org timer."
:group 'modally)
@@ -64,13 +64,13 @@
"A mode-line face used for a paused org timer."
:group 'modally)
-(defface modally-active
- '((t :foreground "#444444"))
+(defface modally-separator-active
+ '((t :inherit 'mode-line))
"A mode-line face used for the active window."
:group 'modally)
-(defface modally-inactive
- '((t :foreground "#222222"))
+(defface modally-separator-inactive
+ '((t :inherit 'vertical-border))
"A mode-line face used for the inactive window."
:group 'modally)
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