emacs: make the prot-modeline faces use colours from the active modus theme

This commit is contained in:
Protesilaos Stavrou 2026-01-08 18:15:28 +02:00
parent 73191d7516
commit 7be95d29f3
No known key found for this signature in database
GPG key ID: 99BD6459CD5CA3EA
2 changed files with 42 additions and 0 deletions

View file

@ -31,6 +31,27 @@
" "
prot-modeline-misc-info))
(when (memq prot-emacs-load-theme-family '(modus ef standard))
(defun prot/modeline-set-faces ()
(modus-themes-with-colors
(custom-set-faces
`(prot-modeline-indicator-red ((,c :foreground ,red)))
`(prot-modeline-indicator-green ((,c :foreground ,green)))
`(prot-modeline-indicator-yellow ((,c :foreground ,yellow)))
`(prot-modeline-indicator-blue ((,c :foreground ,blue)))
`(prot-modeline-indicator-magenta ((,c :foreground ,magenta)))
`(prot-modeline-indicator-cyan ((,c :foreground ,cyan)))
`(prot-modeline-indicator-red-bg ((,c :background ,bg-red-intense :foreground ,fg-main)))
`(prot-modeline-indicator-green-bg ((,c :background ,bg-green-intense :foreground ,fg-main)))
`(prot-modeline-indicator-yellow-bg ((,c :background ,bg-yellow-intense :foreground ,fg-main)))
`(prot-modeline-indicator-blue-bg ((,c :background ,bg-blue-intense :foreground ,fg-main)))
`(prot-modeline-indicator-magenta-bg ((,c :background ,bg-magenta-intense :foreground ,fg-main)))
`(prot-modeline-indicator-cyan-bg ((,c :background ,bg-cyan-intense :foreground ,fg-main))))))
(prot/modeline-set-faces)
(add-hook 'modus-themes-after-load-theme-hook #'prot/modeline-set-faces))
(with-eval-after-load 'spacious-padding
(defun prot/modeline-spacious-indicators ()
"Set box attribute to `'prot-modeline-indicator-button' if spacious-padding is enabled."

View file

@ -3762,6 +3762,27 @@ as soon as the given package/feature is loaded.
" "
prot-modeline-misc-info))
(when (memq prot-emacs-load-theme-family '(modus ef standard))
(defun prot/modeline-set-faces ()
(modus-themes-with-colors
(custom-set-faces
`(prot-modeline-indicator-red ((,c :foreground ,red)))
`(prot-modeline-indicator-green ((,c :foreground ,green)))
`(prot-modeline-indicator-yellow ((,c :foreground ,yellow)))
`(prot-modeline-indicator-blue ((,c :foreground ,blue)))
`(prot-modeline-indicator-magenta ((,c :foreground ,magenta)))
`(prot-modeline-indicator-cyan ((,c :foreground ,cyan)))
`(prot-modeline-indicator-red-bg ((,c :background ,bg-red-intense :foreground ,fg-main)))
`(prot-modeline-indicator-green-bg ((,c :background ,bg-green-intense :foreground ,fg-main)))
`(prot-modeline-indicator-yellow-bg ((,c :background ,bg-yellow-intense :foreground ,fg-main)))
`(prot-modeline-indicator-blue-bg ((,c :background ,bg-blue-intense :foreground ,fg-main)))
`(prot-modeline-indicator-magenta-bg ((,c :background ,bg-magenta-intense :foreground ,fg-main)))
`(prot-modeline-indicator-cyan-bg ((,c :background ,bg-cyan-intense :foreground ,fg-main))))))
(prot/modeline-set-faces)
(add-hook 'modus-themes-after-load-theme-hook #'prot/modeline-set-faces))
(with-eval-after-load 'spacious-padding
(defun prot/modeline-spacious-indicators ()
"Set box attribute to `'prot-modeline-indicator-button' if spacious-padding is enabled."