irc: add new segment to display the unread status

This segment is meant for the main modeline and just displays a single,
unread icon if there are any unread irc buffers.
This commit is contained in:
Sean Farley 2019-02-03 23:06:51 -08:00
parent b6b6691ea3
commit c0cbf56db4
2 changed files with 18 additions and 1 deletions

View file

@ -1559,6 +1559,23 @@ we don't want to remove that so we just return the original."
;; add a space at the end to pad against the following segment ;; add a space at the end to pad against the following segment
(concat " " (doom-modeline--tracking-buffers tracking-buffers) " "))) (concat " " (doom-modeline--tracking-buffers tracking-buffers) " ")))
(doom-modeline-def-segment irc
"A notification icon for any unread irc buffer."
(when (and doom-modeline-irc
(boundp 'tracking-mode-line-buffers)
(> (length tracking-buffers) 0)
(doom-modeline--active))
(concat
" "
(propertize (doom-modeline-icon-material "sms"
:height 0.9
:face 'doom-modeline-warning)
'help-echo (format "IRC Notifications: %s"
(doom-modeline--tracking-buffers
tracking-buffers))
'display '(raise -0.17))
" ")))
(provide 'doom-modeline-segments) (provide 'doom-modeline-segments)
;;; doom-modeline-segments.el ends here ;;; doom-modeline-segments.el ends here

View file

@ -84,7 +84,7 @@
(doom-modeline-def-modeline 'main (doom-modeline-def-modeline 'main
'(bar workspace-number window-number evil-state god-state ryo-modal xah-fly-keys matches buffer-info remote-host buffer-position parrot selection-info) '(bar workspace-number window-number evil-state god-state ryo-modal xah-fly-keys matches buffer-info remote-host buffer-position parrot selection-info)
'(misc-info persp-name lsp mu4e github debug minor-modes input-method buffer-encoding major-mode process vcs checker)) '(misc-info persp-name lsp irc mu4e github debug minor-modes input-method buffer-encoding major-mode process vcs checker))
(doom-modeline-def-modeline 'minimal (doom-modeline-def-modeline 'minimal
'(bar matches " " buffer-info) '(bar matches " " buffer-info)