sinic / ednc

The Emacs Desktop Notification Center helps you manage all your desktop notifications without leaving Emacs.
GNU General Public License v3.0
70 stars 2 forks source link

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

Open formula-spectre opened 11 months ago

formula-spectre commented 11 months ago

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

sinic commented 11 months ago

The implemented specification prescribes semantics that go beyond simple linear output. There's an expectation, for example, that notifications get closed at some point (by the user, by the application, or by expiry). And if graphical representations of notifications stick around beyond their true lifetime, a user might try to invoke actions on notifications that the application no longer knows about.

That said, there's a hook ednc-notification-presentation-functions, by default containing the internal ednc--update-log-buffer function, that you can take a look at for inspiration. If you're okay with confusing behavior like the one I described above, you can put a function there that simply appends (the data of the new) notification to a file, or calls some external program.

formula-spectre commented 11 months ago

i just want emacs to be my notification manager but also a pop up man
jk, i'll take a look; i'll leave this open until I find a hack (or a curse) that allows me to achieve it

sinic commented 11 months ago

i just want emacs to be my notification manager but also a pop up man

To be clear, the ednc-notification-presentation-functions hook can contain an arbitrary number of functions. If you keep the ednc--update-log-buffer function in there, EDNC keeps working as it does by default, but at the same time you can have a function in there that calls external programs, or appends notifications to a file, or whatever.

Just be aware that there are situations where the behaviour of the external program might look odd. In that case you can resort to the regular EDNC way of doing things.