julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.36k stars 331 forks source link

Just use alerter? #278

Closed JCsplash closed 3 years ago

JCsplash commented 4 years ago

@julienXX Thanks for the great library!

It seems like alerter can do everything terminal-notiifer can do, plus having reply / actions. Would you recommend just installing alerter? Or do you recommend having both?

JCsplash commented 4 years ago

After digging through the source code, here's what i found. Hope this helps someone.

  1. Terminal-Notifier finishes running immediately after its notifications are sent. Notifications from Alerter require user action before it releases from memory. If you just need notifications without action, use Terminal-Notifier (don't use alerter and set Notification Style to Banner - otherwise there'll be memory leaks)

  2. Terminal-Notifier is packaged as an application and uses applicationDidFinishLaunching(_ aNotification: Notification) to detect whether the user started a new notification or pressed on an existing notification and if so what to do (ex. launch an app, run a shell script..etc). Alerter is packaged as a command line utility and waits for a user response (ex. button press, reply..etc) rather than using applicationDidFinishLaunching in a new instance of Alerter.

I can see why Terminal-Notifier and Alerter are now separate apps in version 2.0 - but perhaps there is a cleaner way to combine the two. I'll look more into this.

  1. Terminal-Notifier has a "Ignore Do Not Disturb" flag which i recently added to alerter in this pull request.
Sergey-Galan commented 3 years ago

https://github.com/vjeantet/alerter/issues/19