• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

julienXX/terminal-notifier: Send User Notifications on macOS from the command-li ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

julienXX/terminal-notifier

开源软件地址(OpenSource Url):

https://github.com/julienXX/terminal-notifier

开源编程语言(OpenSource Language):

Objective-C 57.7%

开源软件介绍(OpenSource Introduction):

terminal-notifier

GitHub release

terminal-notifier is a command-line tool to send macOS User Notifications, which are available on macOS 10.10 and higher.

News

alerter features were merged in terminal-notifier 1.7. This led to some issues and even more issues in the 1.8 release. We decided with Valère Jeantet to rollback this merge.

From now on terminal-notifier won't have the sticky notification feature nor the actions buttons. If you need them please use alerter. I also want to follow semver hence this latest version starts at 2.0.0.

Sticking to two smaller specialized tools will hopefully make them easier to maintain and less error prone.

Caveats

  • It is currently packaged as an application bundle, because NSUserNotification does not work from a ‘Foundation tool’. radar://11956694

  • If you intend to package terminal-notifier with your app to distribute it on the Mac App Store, please use 1.5.2; version 1.6.0+ uses a private method override, which is not allowed in the App Store Guidelines.

  • If you're using macOS < 10.10 you should use terminal-notifier 1.6.3.

  • If you're looking for sticky notifications or more actions on a notification please use alerter

Download

Prebuilt binaries are available from the releases section.

Or if you want to use this from Ruby, you can install it through RubyGems:

$ [sudo] gem install terminal-notifier

You can also install it via Homebrew:

$ brew install terminal-notifier

Usage

$ ./terminal-notifier.app/Contents/MacOS/terminal-notifier -[message|group|list] [VALUE|ID|ID] [options]

In order to use terminal-notifier, you have to call the binary inside the application bundle.

The Ruby gem, which wraps this tool, does have a bin wrapper. If installed you can simply do:

$ terminal-notifier -[message|group|list] [VALUE|ID|ID] [options]

This will obviously be a bit slower than using the tool without the wrapper.

If you'd like notifications to stay on the screen until dismissed, go to System Preferences -> Notifications -> terminal-notifier and change the style from Banners to Alerts. You cannot do this on a per-notification basis.

Example Uses

Display piped data with a sound:

$ echo 'Piped Message Data!' | terminal-notifier -sound default

Example 1

Use a custom icon:

$ terminal-notifier -title ProjectX -subtitle "new tag detected" -message "Finished" -appIcon http://vjeantet.fr/images/logo.png

Example 3

Open an URL when the notification is clicked:


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap