Code Monkey home page Code Monkey logo

ednc's People

Contributors

frostyx avatar sinic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ednc's Issues

Screenshots

Are there any screenshots to be able to see how notifications look? Thank you.

general experience, ideas, and 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 valid association list

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!

Support for embedded images could be better

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

  • most of the time the icon is… just an icon, which looks bad when shown in full size, and
  • similar to issue #7, the proper way to include images (as opposed to icons) is to use XML-based markup.

Thus it's better to always clearly separate icons from the notification bodies, and to only expand them if explicitly asked for.

FYI: if-let, when-let, pcase-let

Hi,

This package looks very cool! FYI, you might like to use the when-let and if-let macros, e.g. here:

ednc/ednc.el

Line 312 in b756e31

(let ((timer (ednc-notification-timer notification)))

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.

ednc-dismiss-notification key binding not working for me

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

Emacs Desktop Notification Center youtube

Displaying new notifications in new frames is undocumented

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.

Feature requests

  1. Can we have a function that closes all expanded views in ednc-log buffer?
    The reason why I would like this is because I open all new notifications in expanded form.
  2. Can we have a way to close previous notifications upon new ones arriving?

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.

Interference by `openwith.el`

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.

would calling something like herbe/wayherb still be possible with an hook with ednc?

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

Support for embedded URLs could be better

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.