julienXX / terminal-notifier

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

Documentation not up to date #268

Closed himat closed 5 years ago

himat commented 5 years ago

Please check everything that applies to your issue:

Why is the documentation not up to date?

$ terminal-notifier -h
terminal-notifier (2.0.0) is a command-line tool to send macOS User Notifications.

Usage: terminal-notifier -[message|list|remove] [VALUE|ID|ID] [options]

   Either of these is required (unless message data is piped to the tool):

       -help              Display this help banner.
       -version           Display terminal-notifier version.
       -message VALUE     The notification message.
       -remove ID         Removes a notification with the specified ‘group’ ID.
       -list ID           If the specified ‘group’ ID exists show when it was delivered,
                          or use ‘ALL’ as ID to see all notifications.
                          The output is a tab-separated list.

   Optional:

       -title VALUE       The notification title. Defaults to ‘Terminal’.
       -subtitle VALUE    The notification subtitle.
       -sound NAME        The name of a sound to play when the notification appears. The names are listed
                          in Sound Preferences. Use 'default' for the default notification sound.
       -group ID          A string which identifies the group the notifications belong to.
                          Old notifications with the same ID will be removed.
       -activate ID       The bundle identifier of the application to activate when the user clicks the notification.
       -sender ID         The bundle identifier of the application that should be shown as the sender, including its icon.
       -appIcon URL       The URL of a image to display instead of the application icon (Mavericks+ only)
       -contentImage URL  The URL of a image to display attached to the notification (Mavericks+ only)
       -open URL          The URL of a resource to open when the user clicks the notification.
       -execute COMMAND   A shell command to perform when the user clicks the notification.
       -ignoreDnD         Send notification even if Do Not Disturb is enabled.

When the user activates a notification, the results are logged to the system logs.
Use Console.app to view these logs.

Note that in some circumstances the first character of a message has to be escaped in order to be recognized.
An example of this is when using an open bracket, which has to be escaped like so: ‘\[’.

For more information see https://github.com/julienXX/terminal-notifier.

But apparently looking at some issues, there seems to be a -timeout option which would be really nice to know about. And I don't even know what other options I'm not aware of because they're not being printed.

julienXX commented 5 years ago

There used to be some more options in terminal-notifier 1.7 but they were buggy and removed since. Documentation is up to date with the application abilities.

himat commented 5 years ago

Is there any program you know of where I can pass a timeout to a notification then? I only want a temporary notification that disappears even if the user doesn't do anything.

julienXX commented 5 years ago

Try alerter which is a fork of terminal-notifier with this option. It's not much maintained though. Otherwise I guess you can try something with AppleScript.