Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get sx.el inbox new message count in mode-line? #351

Open
stardiviner opened this issue Feb 23, 2018 · 1 comment
Open

How to get sx.el inbox new message count in mode-line? #351

stardiviner opened this issue Feb 23, 2018 · 1 comment

Comments

@stardiviner
Copy link

I have a config as following:

;;; GitHub Notifications (Participating)
(use-package ghub+
  :ensure t
  :config
  (defvar github-notifications-number nil)
  (defun github-notifications ()
    (setq github-notifications-number
          (length
           ;; check out documentation of `ghubp-get-notifications'.
           (ghubp-get-notifications :participating "true") ; from package `ghub+'.
           ;; (ghub-get "/notifications" '((:participating . "true")))
           ;; (ghub-get "/notifications")
           )))
  (run-with-timer 10 600 'github-notifications)
  (defun *github-notifications ()
    (if (and (active) (> github-notifications-number 0))
        (propertize
         (concat
          (all-the-icons-faicon "github" :v-adjust 0.05)
          (format " %s " github-notifications-number))
         'face 'mode-line-data-face)))
  (defun github-open-notifications-participating ()
    "Open GitHub Notifications/Participating page."
    (interactive)
    (browse-url "https://github.com/notifications/participating"))
  (unless (boundp 'prog-vcs-prefix)
    (define-prefix-command 'prog-vcs-prefix))
  (define-key prog-vcs-prefix (kbd "N") 'github-open-notifications-participating)
  )

I use function *github-notifications in my custom mode-line-format to show GitHub notifications.
How can I do this for sx.el?

@stardiviner
Copy link
Author

I check out sx-inbox.el source code, but hardly to implement one function by myself (I'm not good enough on Elisp). Only know related functions sx-inbox--print-info and sx-inbox-item-type-unread etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant