feat(look-and-feel): Display unread mail telephone line segment

Defines a new highlight face and configures the telephone line
segments to display the unread count if there are unread mails.
This commit is contained in:
Vincent Ambo 2018-06-15 01:14:28 +02:00
parent e543ddff2e
commit 454cb9e506
2 changed files with 11 additions and 5 deletions

View file

@ -27,6 +27,7 @@
;; After initialisation, proceed to load configuration that requires packages: ;; After initialisation, proceed to load configuration that requires packages:
(defun load-other-settings () (defun load-other-settings ()
(mapc 'require '(nixos (mapc 'require '(nixos
mail-setup
look-and-feel look-and-feel
functions functions
settings settings
@ -37,7 +38,6 @@
haskell-setup haskell-setup
rust-setup rust-setup
lisp-setup lisp-setup
mail-setup
))) )))
(add-hook 'after-init-hook 'load-other-settings) (add-hook 'after-init-hook 'load-other-settings)

View file

@ -42,20 +42,26 @@
The idea is to not display information like the current time, The idea is to not display information like the current time,
load, battery levels in all buffers." load, battery levels in all buffers."
(if (bottom-right-window-p) (when (bottom-right-window-p)
(telephone-line-raw mode-line-misc-info t) (telephone-line-raw mode-line-misc-info t)))
""))
(telephone-line-defsegment telephone-line-last-window-segment () (telephone-line-defsegment telephone-line-last-window-segment ()
(telephone-misc-if-last-window)) (telephone-misc-if-last-window))
;; Define a highlight font for ~ important ~ information in the last
;; window.
(defface special-highlight '((t (:foreground "white" :background "#5f627f"))) "")
(add-to-list 'telephone-line-faces
'(highlight . (special-highlight . special-highlight)))
(setq telephone-line-lhs (setq telephone-line-lhs
'((nil . (telephone-line-position-segment)) '((nil . (telephone-line-position-segment))
(accent . (telephone-line-buffer-segment)))) (accent . (telephone-line-buffer-segment))))
(setq telephone-line-rhs (setq telephone-line-rhs
'((accent . (telephone-line-major-mode-segment)) '((accent . (telephone-line-major-mode-segment))
(nil . (telephone-line-last-window-segment)))) (nil . (telephone-line-last-window-segment))
(highlight . (telephone-line-notmuch-counts))))
(setq telephone-line-primary-left-separator 'telephone-line-tan-left (setq telephone-line-primary-left-separator 'telephone-line-tan-left
telephone-line-primary-right-separator 'telephone-line-tan-right telephone-line-primary-right-separator 'telephone-line-tan-right