Improve colors in mu4e and elfeed

This commit is contained in:
Jens Luedicke
2025-09-05 15:29:31 +02:00
parent f95ff8d303
commit d53e259670
3 changed files with 170 additions and 10 deletions

View File

@@ -310,7 +310,142 @@
`(ansi-color-blue ((,class (:foreground ,blue :background ,blue)))) `(ansi-color-blue ((,class (:foreground ,blue :background ,blue))))
`(ansi-color-magenta ((,class (:foreground ,magenta :background ,magenta)))) `(ansi-color-magenta ((,class (:foreground ,magenta :background ,magenta))))
`(ansi-color-cyan ((,class (:foreground ,cyan :background ,cyan)))) `(ansi-color-cyan ((,class (:foreground ,cyan :background ,cyan))))
`(ansi-color-white ((,class (:foreground ,fg-main :background ,fg-main)))))) `(ansi-color-white ((,class (:foreground ,fg-main :background ,fg-main))))
;; mu4e - Email client
`(mu4e-header-face ((,class (:foreground ,fg-main))))
`(mu4e-header-highlight-face ((,class (:background ,bg-region :weight bold :extend t))))
`(mu4e-header-marks-face ((,class (:foreground ,yellow :weight bold))))
`(mu4e-header-title-face ((,class (:foreground ,blue :weight bold))))
`(mu4e-header-key-face ((,class (:foreground ,green :weight bold))))
`(mu4e-header-value-face ((,class (:foreground ,fg-main))))
`(mu4e-unread-face ((,class (:foreground ,cyan :weight bold))))
`(mu4e-flagged-face ((,class (:foreground ,red :weight bold))))
`(mu4e-replied-face ((,class (:foreground ,green))))
`(mu4e-forwarded-face ((,class (:foreground ,blue))))
`(mu4e-draft-face ((,class (:foreground ,orange))))
`(mu4e-trashed-face ((,class (:foreground ,fg-dim :strike-through t))))
`(mu4e-cited-1-face ((,class (:foreground ,blue))))
`(mu4e-cited-2-face ((,class (:foreground ,green))))
`(mu4e-cited-3-face ((,class (:foreground ,yellow))))
`(mu4e-cited-4-face ((,class (:foreground ,cyan))))
`(mu4e-cited-5-face ((,class (:foreground ,magenta))))
`(mu4e-cited-6-face ((,class (:foreground ,orange))))
`(mu4e-cited-7-face ((,class (:foreground ,purple))))
`(mu4e-compose-separator-face ((,class (:foreground ,fg-dim :strike-through t))))
`(mu4e-compose-header-face ((,class (:foreground ,fg-dim))))
`(mu4e-contact-face ((,class (:foreground ,blue))))
`(mu4e-context-face ((,class (:foreground ,purple :weight bold))))
`(mu4e-highlight-face ((,class (:background ,bg-active))))
`(mu4e-link-face ((,class (:foreground ,blue :underline t))))
`(mu4e-modeline-face ((,class (:foreground ,yellow :weight bold))))
`(mu4e-moved-face ((,class (:foreground ,magenta))))
`(mu4e-ok-face ((,class (:foreground ,green :weight bold))))
`(mu4e-region-code ((,class (:background ,bg-active))))
`(mu4e-special-header-value-face ((,class (:foreground ,cyan))))
`(mu4e-system-face ((,class (:foreground ,fg-dim :slant italic))))
`(mu4e-title-face ((,class (:foreground ,blue :weight bold))))
`(mu4e-url-number-face ((,class (:foreground ,orange :weight bold))))
`(mu4e-view-body-face ((,class (:foreground ,fg-main))))
`(mu4e-warning-face ((,class (:foreground ,yellow :weight bold))))
`(mu4e-attach-number-face ((,class (:foreground ,orange :weight bold))))
;; mu4e headers specific
`(mu4e-headers-date-face ((,class (:foreground ,fg-dim))))
`(mu4e-headers-from-face ((,class (:foreground ,blue))))
`(mu4e-headers-subject-face ((,class (:foreground ,fg-main))))
`(mu4e-headers-size-face ((,class (:foreground ,fg-dim))))
`(mu4e-headers-seen-face ((,class (:foreground ,fg-dim))))
`(mu4e-headers-unread-face ((,class (:foreground ,cyan :weight bold))))
`(mu4e-headers-flagged-face ((,class (:foreground ,red :weight bold))))
`(mu4e-headers-new-face ((,class (:foreground ,green :weight bold))))
`(mu4e-headers-passed-face ((,class (:foreground ,blue))))
`(mu4e-headers-replied-face ((,class (:foreground ,green))))
`(mu4e-headers-trashed-face ((,class (:foreground ,fg-dim :strike-through t))))
`(mu4e-headers-draft-face ((,class (:foreground ,orange))))
;; elfeed - RSS/News reader
`(elfeed-log-date-face ((,class (:foreground ,fg-dim))))
`(elfeed-log-debug-level-face ((,class (:foreground ,fg-dim))))
`(elfeed-log-error-level-face ((,class (:foreground ,red))))
`(elfeed-log-info-level-face ((,class (:foreground ,blue))))
`(elfeed-log-warn-level-face ((,class (:foreground ,yellow))))
;; elfeed search buffer
`(elfeed-search-date-face ((,class (:foreground ,purple))))
`(elfeed-search-feed-face ((,class (:foreground ,cyan))))
`(elfeed-search-filter-face ((,class (:foreground ,green :weight bold))))
`(elfeed-search-last-update-face ((,class (:foreground ,blue))))
`(elfeed-search-tag-face ((,class (:foreground ,yellow))))
`(elfeed-search-title-face ((,class (:foreground ,fg-main))))
`(elfeed-search-unread-count-face ((,class (:foreground ,green :weight bold))))
`(elfeed-search-unread-title-face ((,class (:foreground ,fg-bright :weight bold))))
;; Custom elfeed tag faces (override hardcoded colors from elfeed-config.el)
`(elfeed-face-tag-news ((,class (:foreground ,orange)))) ; Was "#8B4513" (saddle brown)
`(elfeed-face-tag-tech ((,class (:foreground ,blue)))) ; Was "#4682B4" (steel blue)
`(elfeed-face-tag-security ((,class (:foreground ,red)))) ; Was "#DC143C" (crimson)
`(elfeed-face-tag-programming ((,class (:foreground ,green)))) ; Was "#228B22" (forest green)
`(elfeed-face-tag-opensource ((,class (:foreground ,cyan))))
;; elfeed show buffer (article view)
`(elfeed-show-author-face ((,class (:foreground ,blue))))
`(elfeed-show-feed-face ((,class (:foreground ,cyan))))
`(elfeed-show-tag-face ((,class (:foreground ,yellow))))
`(elfeed-show-title-face ((,class (:foreground ,fg-bright :weight bold :height 1.3))))
;; Special tags - customize these for your own tags
`(elfeed-search-starred-title-face ((,class (:foreground ,yellow :weight bold))))
`(elfeed-search-mustread-title-face ((,class (:foreground ,red :weight bold))))
`(elfeed-search-later-title-face ((,class (:foreground ,orange))))
`(elfeed-search-important-title-face ((,class (:foreground ,magenta :weight bold))))
;; Gnus (sometimes used with mu4e)
`(gnus-header-content ((,class (:foreground ,fg-main))))
`(gnus-header-from ((,class (:foreground ,blue :weight bold))))
`(gnus-header-subject ((,class (:foreground ,green))))
`(gnus-header-name ((,class (:foreground ,purple))))
`(gnus-header-newsgroups ((,class (:foreground ,yellow))))
;; Message mode (email composition)
`(message-header-name ((,class (:foreground ,purple :weight bold))))
`(message-header-cc ((,class (:foreground ,blue))))
`(message-header-newsgroups ((,class (:foreground ,yellow))))
`(message-header-other ((,class (:foreground ,cyan))))
`(message-header-subject ((,class (:foreground ,green :weight bold))))
`(message-header-to ((,class (:foreground ,blue :weight bold))))
`(message-header-xheader ((,class (:foreground ,fg-dim))))
`(message-mml ((,class (:foreground ,orange :weight bold))))
`(message-separator ((,class (:foreground ,fg-dim :strike-through t))))
`(message-cited-text ((,class (:foreground ,fg-dim :slant italic))))
`(message-cited-text-1 ((,class (:foreground ,blue))))
`(message-cited-text-2 ((,class (:foreground ,green))))
`(message-cited-text-3 ((,class (:foreground ,yellow))))
`(message-cited-text-4 ((,class (:foreground ,cyan))))
;; Notmuch (alternative email client)
`(notmuch-crypto-decryption ((,class (:foreground ,green))))
`(notmuch-crypto-signature-bad ((,class (:foreground ,red))))
`(notmuch-crypto-signature-good ((,class (:foreground ,green))))
`(notmuch-crypto-signature-good-key ((,class (:foreground ,green :weight bold))))
`(notmuch-crypto-signature-unknown ((,class (:foreground ,yellow))))
`(notmuch-search-date ((,class (:foreground ,purple))))
`(notmuch-search-count ((,class (:foreground ,fg-dim))))
`(notmuch-search-flagged-face ((,class (:foreground ,red))))
`(notmuch-search-matching-authors ((,class (:foreground ,blue))))
`(notmuch-search-non-matching-authors ((,class (:foreground ,fg-dim))))
`(notmuch-search-subject ((,class (:foreground ,fg-main))))
`(notmuch-search-unread-face ((,class (:foreground ,cyan :weight bold))))
`(notmuch-tag-added ((,class (:foreground ,green :weight bold))))
`(notmuch-tag-deleted ((,class (:foreground ,red :strike-through t))))
`(notmuch-tag-face ((,class (:foreground ,yellow))))
`(notmuch-tag-flagged ((,class (:foreground ,red :weight bold))))
`(notmuch-tag-unread ((,class (:foreground ,cyan :weight bold))))
`(notmuch-tree-match-author-face ((,class (:foreground ,blue))))
`(notmuch-tree-match-date-face ((,class (:foreground ,purple))))
`(notmuch-tree-match-subject-face ((,class (:foreground ,fg-main))))
`(notmuch-tree-match-tag-face ((,class (:foreground ,yellow))))
`(notmuch-tree-no-match-face ((,class (:foreground ,fg-dim))))))
;;;###autoload ;;;###autoload
(when load-file-name (when load-file-name

View File

@@ -1,4 +1,7 @@
;;; elfeed-config.el --- Elfeed RSS reader configuration ;;; elfeed-config.el --- Elfeed RSS reader configuration -*- lexical-binding: t -*-
;;; Commentary:
;; Configuration for Elfeed RSS reader with custom faces and filtering functions
;;; Code: ;;; Code:
@@ -361,11 +364,31 @@ If USE-GENERIC-P is non-nil, use eww-readable after loading."
(define-key elfeed-show-mode-map (kbd "B") 'elfeed-open-in-browser)) (define-key elfeed-show-mode-map (kbd "B") 'elfeed-open-in-browser))
;; Disable line numbers in elfeed buffers ;; Disable line numbers in elfeed buffers
(add-hook 'elfeed-show-mode-hook (lambda () (display-line-numbers-mode 0))) (add-hook 'elfeed-show-mode-hook
(add-hook 'elfeed-search-mode-hook (lambda () (display-line-numbers-mode 0))) (lambda ()
(display-line-numbers-mode -1)
(setq-local display-line-numbers nil)))
(add-hook 'elfeed-search-mode-hook
(lambda ()
(display-line-numbers-mode -1)
(setq-local display-line-numbers nil)))
;; Disable line numbers in EWW ;; Disable line numbers in EWW
(add-hook 'eww-mode-hook (lambda () (display-line-numbers-mode 0))) (add-hook 'eww-mode-hook
(lambda ()
(display-line-numbers-mode -1)
(setq-local display-line-numbers nil)))
;; Additional function to force disable line numbers in elfeed
(defun elfeed-disable-line-numbers ()
"Forcefully disable line numbers in elfeed buffers."
(interactive)
(when (or (eq major-mode 'elfeed-search-mode)
(eq major-mode 'elfeed-show-mode))
(display-line-numbers-mode -1)
(setq-local display-line-numbers nil)
(message "Line numbers disabled in elfeed")))
(provide 'elfeed-config) (provide 'elfeed-config)
;;; elfeed-config.el ends here ;;; elfeed-config.el ends here

12
init.el
View File

@@ -68,7 +68,9 @@
'(cua-mode t) '(cua-mode t)
'(custom-enabled-themes '(developer-dark)) '(custom-enabled-themes '(developer-dark))
'(custom-safe-themes '(custom-safe-themes
'("de2f009a49f8eaf2f323519d86016849cd1716d979bc3f7e4afb58899e52ddb7" '("2974c2d5ffede4f111b02701ccdfadfbcde3d158ad9b09dade627b3ce3049ea1"
"f8859f15bd0089a85d8d14e21dd774a9a8b391dac076e3ff17a13529b3d16576"
"de2f009a49f8eaf2f323519d86016849cd1716d979bc3f7e4afb58899e52ddb7"
"9fb69436c074b82a62b78b8d733e6274d0bd16d156f7b094e2afe4345c040c49" "9fb69436c074b82a62b78b8d733e6274d0bd16d156f7b094e2afe4345c040c49"
"004f174754c688f358fa2afc4f8699b5db647fbfaa0d6b55ff39f63e05bfbbf5" "004f174754c688f358fa2afc4f8699b5db647fbfaa0d6b55ff39f63e05bfbbf5"
"ca1b398ceb1b61709197478dc7f705b8337a0a9631e399948e643520c5557382" "ca1b398ceb1b61709197478dc7f705b8337a0a9631e399948e643520c5557382"
@@ -741,11 +743,11 @@
(message "mu4e configuration available but mu4e not installed. Install mu4e package to enable email."))))) (message "mu4e configuration available but mu4e not installed. Install mu4e package to enable email.")))))
;;; Theme Management ;;; Theme Management
(defun load-developer-dark-theme () (defun load-jens-dark-theme ()
"Load the custom developer-dark theme." "Load the custom jens-dark theme."
(interactive) (interactive)
(load-theme 'developer-dark t) (load-theme 'jens-dark t)
(message "Developer Dark theme loaded")) (message "Jens Dark theme loaded"))
(defun switch-theme (theme) (defun switch-theme (theme)
"Switch to a different theme interactively." "Switch to a different theme interactively."