Function: doom-modeline-segment--github

doom-modeline-segment--github is a natively compiled function defined in doom-modeline-segments.el.

Signature

(doom-modeline-segment--github)

Documentation

The GitHub notifications.

Source Code

;; Defined in /nix/store/1lcicrdd2r4b8rkc91nnn74ymk1jl6yd-emacs-packages-deps/share/emacs/site-lisp/elpa/doom-modeline-20260928.1632/doom-modeline-segments.el
(doom-modeline-def-segment github
  "The GitHub notifications."
  (when (and doom-modeline-github
             (doom-modeline--segment-visible 'github)
             (numberp doom-modeline--github-notification-number))
    (let ((sep (doom-modeline-spc)))
      (concat
       sep
       (propertize
        (concat
         (doom-modeline-icon 'octicon "nf-oct-mark_github" "🔔" "&"
                             :face 'doom-modeline-notification)
         (and (> doom-modeline--github-notification-number 0) (doom-modeline-vspc))
         (propertize
          (cond
           ((<= doom-modeline--github-notification-number 0) "")
           ((> doom-modeline--github-notification-number 99) "99+")
           (t (number-to-string doom-modeline--github-notification-number)))
          'face '(:inherit
                  (doom-modeline-unread-number doom-modeline-notification))))
        'help-echo "Github Notifications
mouse-1: Show notifications
mouse-3: Fetch notifications"
        'mouse-face 'doom-modeline-highlight
        'local-map (let ((map (make-sparse-keymap)))
                     (define-key map [mode-line mouse-1]
                       (lambda ()
                         "Open GitHub notifications page."
                         (interactive)
                         (run-with-idle-timer 300 nil #'doom-modeline--github-fetch-notifications)
                         (browse-url "https://github.com/notifications")))
                     (define-key map [mode-line mouse-3]
                       (lambda ()
                         "Fetching GitHub notifications."
                         (interactive)
                         (message "Fetching GitHub notifications...")
                         (doom-modeline--github-fetch-notifications)))
                     map))
       sep))))