Closed danielkrajnik closed 1 year ago
(defun elfeed-desktop-notifications (entry)
"Parse and display new feeds as desktop notifications."
(alert (elfeed-deref (elfeed-entry-content entry))
:title (concat
(elfeed-feed-title (elfeed-deref (elfeed-entry-feed entry))) "\n"
(elfeed-deref (elfeed-entry-title entry))
)
:severity 'high
))
(add-hook 'elfeed-new-entry-hook #'elfeed-desktop-notifications)
On a general note, I wish elisp had some typing system? I get that there are conventions, but developers may not always stick to them (elfeed as shown above did though) and if you are new it might have been easier?
On a tangential note, I wish desktop notifications had a "subtitle".
On a philosophical note, I haven't seen an emacs pacakage yet that had desktop notifications integrated out-of-the-box? I really wonder why? They are useful, no?
danielkrajnik @.***> writes:
On a general note, I wish elisp had some typing system? I get that there are conventions, but as you mentioned developers may not always stick to them (elfeed as shown above did though) and if you are new it might have been easier?
But it does? See here: https://www.gnu.org/software/emacs/manual/html_mono/elisp.html#Lisp-Data-Types
On a tangential note, I wish desktop notifications had a "subtitle".
On a philosophical note, I haven't seen an emacs pacakage yet that had desktop notifications integrated out-of-the-box? I really wonder why? They are useful, no?
Support for Freedesktop notifications is built-in
https://www.gnu.org/software/emacs/manual/html_node/elisp/Desktop-Notifications.html
and John Wiegly has a package (of course) that I believe is cross-platform:
https://github.com/jwiegley/alert
-- Michael @.***>
and John Wiegly has a package (of course) that I believe is cross-platform: https://github.com/jwiegley/alert
@sp1ff That's the exact package also used in this example, but AFAIK it doesn't have a "subtitle" property (please see the image below, the second paragraph is just part of the :title
property):
I've been trying for the past three days to get elfeed to display desktop notifications. It was suggested that
'elfeed-new-entry-hook
can be used and it works, but parsing is a huge trial and error.I added
"https://lorem-rss.herokuapp.com/feed?unit=second&interval=10"
feed to be able to test it.This works for example:
But changing
elfeed-entry-title
toelfeed-entry-tags
orelfeed-entry-
feed` makes it fail (no notifications appear anymore).Does anyone have any idea why?