sinic / ednc Goto Github PK
View Code? Open in Web Editor NEWThe Emacs Desktop Notification Center helps you manage all your desktop notifications without leaving Emacs.
License: GNU General Public License v3.0
The Emacs Desktop Notification Center helps you manage all your desktop notifications without leaving Emacs.
License: GNU General Public License v3.0
Are there any screenshots to be able to see how notifications look? Thank you.
I am wont to browse old Sacha Chua emacs news post for tid-bits I may have
missed the first time I saw them. Had I not done this, I would probably have not
seen this package--and even then when I saw this package's name ednc - Emacs Desktop Notification Center
I almost skipped it because I had a vague idea of
what it was. Luckily, I didn't. When I actually realized what this package did
my interest quickly rose. Just a few days ago I had installed dunst and I had
been dreading having to figure out its configuration language. Because of this
package, I can throw that package out of the window with gusto.
I am still experimenting with this package trying to figure out how to best
display notifications. The example you gave on popping notification buffers was
useful, however I don't think I will adopt this approach because I want
notifications to show up in a small box (probably on the right-hand corner) and
I don't see how you can get a buffer there in a layout that has few splits (at
least without creating many buffer splits). I want something like a floating
window just as popups typically show up. I thought I could either use a frame or
a posframe. Since I use exwm and as per my experiments it does not seem frames
stack in exwm (though I could be wrong, I'll ask about this), I tried postframe.
This is the test I've done so far based on your example. Of course I need to
change :position
so it's not always at point--I'll see how ivy-posframe
does
that. It seems promising, though I would want a different themes for the
posframe (based on severity of the notification) so I checked out color-theme-buffer-local after reading this stackexchange post.
(defun show-posframe-in-buffer (old new)
(let ((name (format "Notification %d" (ednc-notification-id (or old new)))))
(with-current-buffer (get-buffer-create name)
(if new (let ((inhibit-read-only t))
(if old (erase-buffer) (ednc-view-mode))
(insert (ednc-format-notification new t))
(when (posframe-workable-p)
(posframe-show name :position (point))))
(kill-buffer)))))
(add-hook 'ednc-notification-presentation-functions #'show-posframe-in-buffer)
(notifications-notify :title "ho" :body "hello world my name is bob" :urgency 'critical)
;; use (posframe-hide-all) to get rid of the posframe
This needs much more work to be acceptable, but I'm happy with the start.
I want to propose to add a simple example on how to actually see a notification happening. Not so familiar with notifications, I struggled with that at first when I was trying to figure out how this package works. The test
file is what got me to see that you trigger notifications via notifications-notify
.
Thank you for writing such an amazing package.
ednc--get-hint
errors out on the following call. This looks like a bug. The first argument is a valid association list.
(ednc--get-hint '(("urgency" 1)) "urgency")
Thanks for writing ednc! I use it with exwm and love it!
This is a point mentioned in a YouTube video by @NapoleonWils0n, first brought to my attention in issue #5. I experimented with this in the past, along the lines of what's suggested in the video, but
Thus it's better to always clearly separate icons from the notification bodies, and to only expand them if explicitly asked for.
Hi,
This package looks very cool! FYI, you might like to use the when-let
and if-let
macros, e.g. here:
Line 312 in b756e31
They're in subr-x
.
Also, this is a matter of style, but in case you weren't aware of the pcase-let
macro in Emacs, you could write ednc--remove-old-notification-from-log-buffer
like this:
(defun ednc--remove-old-notification-from-log-buffer (old)
"Remove OLD notification from its log buffer, if it exists."
(pcase-let* (((map logged) (ednc-notification-amendments old))
(`(,buffer . ,position) logged))
(when (buffer-live-p buffer)
(with-current-buffer buffer
(save-excursion
(add-text-properties (goto-char position) (line-end-position)
'(face (:strike-through t))))))))
Note as well that I use when
instead of the "one-armed if
", which is more idiomatic.
Hi Mate
I cant seem to get the ednc-dismiss-notification key binding working in the ednc-log
right clicking the notification does dismiss it but pressing d doesnt work
i did see this part of the read me
"By default, you can use the following mouse controls and key bindings (the latter only in the log buffer):"
the tab works to expand the notification in the log view
when i run M-x ednc-
i can see all the commands but only ednc-toggle-expanded-view has the tab keybinding listed
im running emacs 29,
i was wondering if maybe thats causing the issue with the keybindings
I just switched from gnome's notification center to using ednc and made a video about it,
hope i covered everything properly and didnt miss anything
This is a point mentioned in a YouTube video by @NapoleonWils0n, first brought to my attention in issue #5.
To be clear: how to display notifications is generally up to the user (aside from the log active by default), but the documentation does contain examples like popping to buffers. If someone (possibly me) were to come up with a nice, self-contained example for popping to frames instead, then I'm open to adding it to the README.
Thank you for this package. I have ednc-log buffer open all the time, and I rely on it to an eye on my notifications.
This is a problem mentioned in a YouTube video (at 21:25) by @NapoleonWils0n, first brought to my attention in issue #5. My understanding is that the third party package openwith.el
, in its default configuration, uses external programs to open matching files for every call to insert-file-contents
, even if internal to another package (like EDNC).
Explicitly inhibiting openwith-file-handler
is a bad idea, because who knows how many other packages do something similar?
Fortunately (for EDNC), other packages have the same problem. In particular Gnus, for which openwith.el
's documentation suggest modifying mm-inhibit-file-name-handlers
. It would be best if EDNC would honor the same variable, since there's nothing mail-specific about it.
I think this package can be really powerful; however I would still like a notification pop up; that could be achieved via herbe or wayherb; is there any possibility to do that?
or even write to a file, to mimic my old setup where I had tiramisu, and in my xmobar I showed the contents of the fifo (or tail -n1 of the file, can't recall)
(I shouldn't ask this because atm wayherb is broken lol, but still)
hope I was clear enough because this post was made in such a scatter brain mode
This is a point mentioned in a YouTube video by @NapoleonWils0n, first brought to my attention in issue #5. In the video, plain URLs are inserted in the message body, but a better way to communicate URLs would be to use XML-based markup. Unfortunately, EDNC currently doesn't do any parsing of notification bodies at all (which is allowed by the standard as long as it doesn't claim to be able to do so).
Either way, notifications from Firefox commonly open an URL as their default action, so I don't know how pressing of an issue it really is.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.