mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 11:09:54 +00:00
Change github to GitHub.
This commit is contained in:
parent
572d19f194
commit
b2bd730f1e
3 changed files with 12 additions and 12 deletions
|
@ -31,7 +31,7 @@ The `doom-modeline` was designed for minimalism, and offers:
|
||||||
- An indicator for debug state
|
- An indicator for debug state
|
||||||
- An indicator for current input method
|
- An indicator for current input method
|
||||||
- An indicator for LSP state with `lsp-mode` or `eglot`
|
- An indicator for LSP state with `lsp-mode` or `eglot`
|
||||||
- An indicator for github notifications
|
- An indicator for GitHub notifications
|
||||||
- An indicator for unread emails with `mu4e-alert`
|
- An indicator for unread emails with `mu4e-alert`
|
||||||
- An indicator for irc notifications with `circe`
|
- An indicator for irc notifications with `circe`
|
||||||
- An indicator for buffer position which is compatible with `nyan-mode`
|
- An indicator for buffer position which is compatible with `nyan-mode`
|
||||||
|
@ -208,10 +208,10 @@ Run `M-x customize-group RET doom-modeline RET` or set the variables.
|
||||||
;; Whether display `lsp' state or not. Non-nil to display in mode-line.
|
;; Whether display `lsp' state or not. Non-nil to display in mode-line.
|
||||||
(setq doom-modeline-lsp t)
|
(setq doom-modeline-lsp t)
|
||||||
|
|
||||||
;; Whether display github notifications or not. Requires `ghub` package.
|
;; Whether display GitHub notifications or not. Requires `ghub` package.
|
||||||
(setq doom-modeline-github nil)
|
(setq doom-modeline-github nil)
|
||||||
|
|
||||||
;; The interval of checking github.
|
;; The interval of checking GitHub.
|
||||||
(setq doom-modeline-github-interval (* 30 60))
|
(setq doom-modeline-github-interval (* 30 60))
|
||||||
|
|
||||||
;; Whether display mu4e notifications or not. Requires `mu4e-alert' package.
|
;; Whether display mu4e notifications or not. Requires `mu4e-alert' package.
|
||||||
|
|
|
@ -252,12 +252,12 @@ If the actual char height is larger, it respects the actual char height."
|
||||||
:group 'doom-modeline)
|
:group 'doom-modeline)
|
||||||
|
|
||||||
(defcustom doom-modeline-github nil
|
(defcustom doom-modeline-github nil
|
||||||
"Whether display github notifications or not. Requires `ghub' package."
|
"Whether display GitHub notifications or not. Requires `ghub' package."
|
||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'doom-modeline)
|
:group 'doom-modeline)
|
||||||
|
|
||||||
(defcustom doom-modeline-github-interval 1800 ; (* 30 60)
|
(defcustom doom-modeline-github-interval 1800 ; (* 30 60)
|
||||||
"The interval of checking github."
|
"The interval of checking GitHub."
|
||||||
:type 'integer
|
:type 'integer
|
||||||
:group 'doom-modeline)
|
:group 'doom-modeline)
|
||||||
|
|
||||||
|
|
|
@ -1748,11 +1748,11 @@ mouse-3: Reconnect to server" nick (eglot--major-mode server)))
|
||||||
|
|
||||||
(defvar doom-modeline--github-notifications-number 0)
|
(defvar doom-modeline--github-notifications-number 0)
|
||||||
(defvar doom-modeline-before-github-fetch-notification-hook nil
|
(defvar doom-modeline-before-github-fetch-notification-hook nil
|
||||||
"Hooks before fetching github notifications.
|
"Hooks before fetching GitHub notifications.
|
||||||
Example:
|
Example:
|
||||||
(add-hook 'doom-modeline-before-github-fetch-notification-hook #'auth-source-pass-enable)")
|
(add-hook 'doom-modeline-before-github-fetch-notification-hook #'auth-source-pass-enable)")
|
||||||
(defun doom-modeline--github-fetch-notifications ()
|
(defun doom-modeline--github-fetch-notifications ()
|
||||||
"Fetch github notifications."
|
"Fetch GitHub notifications."
|
||||||
(when (and doom-modeline-github
|
(when (and doom-modeline-github
|
||||||
(fboundp 'async-start))
|
(fboundp 'async-start))
|
||||||
;; load `async' if it exists but is not loaded
|
;; load `async' if it exists but is not loaded
|
||||||
|
@ -1781,7 +1781,7 @@ Example:
|
||||||
|
|
||||||
(defvar doom-modeline--github-timer nil)
|
(defvar doom-modeline--github-timer nil)
|
||||||
(defun doom-modeline-github-timer ()
|
(defun doom-modeline-github-timer ()
|
||||||
"Start/Stop the timer for github fetching."
|
"Start/Stop the timer for GitHub fetching."
|
||||||
(if (timerp doom-modeline--github-timer)
|
(if (timerp doom-modeline--github-timer)
|
||||||
(cancel-timer doom-modeline--github-timer))
|
(cancel-timer doom-modeline--github-timer))
|
||||||
(setq doom-modeline--github-timer
|
(setq doom-modeline--github-timer
|
||||||
|
@ -1801,7 +1801,7 @@ Example:
|
||||||
(doom-modeline-github-timer)
|
(doom-modeline-github-timer)
|
||||||
|
|
||||||
(doom-modeline-def-segment github
|
(doom-modeline-def-segment github
|
||||||
"The github notifications."
|
"The GitHub notifications."
|
||||||
(if (and doom-modeline-github
|
(if (and doom-modeline-github
|
||||||
(doom-modeline--active)
|
(doom-modeline--active)
|
||||||
(> doom-modeline--github-notifications-number 0))
|
(> doom-modeline--github-notifications-number 0))
|
||||||
|
@ -1825,15 +1825,15 @@ mouse-3: Fetch notifications"
|
||||||
'local-map (let ((map (make-sparse-keymap)))
|
'local-map (let ((map (make-sparse-keymap)))
|
||||||
(define-key map [mode-line mouse-1]
|
(define-key map [mode-line mouse-1]
|
||||||
(lambda ()
|
(lambda ()
|
||||||
"Open github notifications page."
|
"Open GitHub notifications page."
|
||||||
(interactive)
|
(interactive)
|
||||||
(run-with-timer 300 nil #'doom-modeline--github-fetch-notifications)
|
(run-with-timer 300 nil #'doom-modeline--github-fetch-notifications)
|
||||||
(browse-url "https://github.com/notifications")))
|
(browse-url "https://github.com/notifications")))
|
||||||
(define-key map [mode-line mouse-3]
|
(define-key map [mode-line mouse-3]
|
||||||
(lambda ()
|
(lambda ()
|
||||||
"Fetching github notifications."
|
"Fetching GitHub notifications."
|
||||||
(interactive)
|
(interactive)
|
||||||
(message "Fetching github notifications...")
|
(message "Fetching GitHub notifications...")
|
||||||
(doom-modeline--github-fetch-notifications)))
|
(doom-modeline--github-fetch-notifications)))
|
||||||
map))
|
map))
|
||||||
(doom-modeline-spc))))
|
(doom-modeline-spc))))
|
||||||
|
|
Loading…
Reference in a new issue