julienXX / terminal-notifier

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

Make notifications 'sticky' #33

Closed briancordanyoung closed 11 years ago

briancordanyoung commented 12 years ago

I don't know if apples API's allow for it, and I didn't see anyone else ask yet, but it would be great if an option was added to make the notification 'sticky' like the Reminders.app can do. I assume it would be based on the group id, but that group id would stay on screen until the user dismissed it. Is this possible?

briancordanyoung commented 12 years ago

Totally goofed on this one. I see now that the user can do this themselves. doh! This issue should be closed.

mklement0 commented 12 years ago

Do you mean globally configuring terminal-notifier to always use 'sticky' notifications, via System Preferences?

I'd still love a way to control 'stickiness' on a per-invocation basis, analogous to what growlnotify offers for Growl.

Like you, however, I don't know if the Notification Center APIs allow that.

philfreo commented 11 years ago

+1 for per-notification stickiness

alloy commented 11 years ago

There does not appear to be a sanctioned API for this, in case anyone finds a solution let me know.

cdenneen commented 11 years ago

Currently you are using Banners which doesn't use sticky but Alerts does by default.

alloy commented 11 years ago

@cdenneen Are you saying that this can be done through the APIs? If so, please let us know or submit a patch.

julienXX commented 11 years ago

It's possible to use Alerts by default by adding this key to Terminal Notifier-Info.plist:

  <key>NSUserNotificationAlertStyle</key>
  <string>alert</string>

But I don't see how we could switch styles on demand.

ceilingcat commented 10 years ago

It would definitely be nice to have a command line option for stickiness, instead of having to set it globally in System Preferences.

tjluoma commented 10 years ago

Absolutely agree. This is the only reason I still use growlnotify for some things

On May 2, 2014, at 2:21 PM, ceilingcat notifications@github.com wrote:

It would definitely be nice to have a command line option for stickiness, instead of having to set it globally in System Preferences.

— Reply to this email directly or view it on GitHub.

y commented 9 years ago

Wouldn't it work if you change globally to Alerts from Banners, then accept an expiration option (and default it if not set), then use a LaunchAgent to clean up expired notifcations?

tjluoma commented 9 years ago

But alerts "steal focus" right? That would be exactly what I do not. I just want something to stay there until I can deal with it.

y commented 9 years ago

Alerts don't appear to steal focus. I checked by running this sleep 5 && terminal-notifier -message test and then switching to a few different apps before the notification was activated. It didn't steal focus from any of them.

zeke commented 9 years ago

+1 for per-notification stickiness

Lvl2Pillow commented 7 years ago

You can use the -timeout flag to dismiss the notification automatically after a duration. This works with the alert style notification. Another idea (which is far from ideal) is to make a copy of the terminal-notifier app and set original to alert style, and the copied one to banner style (shrug).

glasser commented 6 years ago

Here's a PR to add a note about the system preference to the README: https://github.com/julienXX/terminal-notifier/pull/244