From c0cbf56db423f758619b0aa1ef3dd6bb33ee8644 Mon Sep 17 00:00:00 2001 From: Sean Farley Date: Sun, 3 Feb 2019 23:06:51 -0800 Subject: [PATCH] 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. --- doom-modeline-segments.el | 17 +++++++++++++++++ doom-modeline.el | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doom-modeline-segments.el b/doom-modeline-segments.el index 80b6f04..6d1a161 100644 --- a/doom-modeline-segments.el +++ b/doom-modeline-segments.el @@ -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 (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) ;;; doom-modeline-segments.el ends here diff --git a/doom-modeline.el b/doom-modeline.el index c462b43..0a12b2b 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -84,7 +84,7 @@ (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) - '(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 '(bar matches " " buffer-info)