28 releases (stable)
|3.6.0||May 16, 2019|
|3.5.0||Oct 21, 2018|
|3.4.2||Aug 19, 2017|
|3.4.1||Jul 9, 2017|
|0.9.0||Jun 30, 2015|
#2 in Unix APIs
715 downloads per month
Used in 26 crates (24 directly)
Shows desktop notifications. This implementation does not rely on libnotify, as it is using dbus-rs. Basic notification features are supported, more sophisticated functionality will follow. The API shown below should be stable.
[dependencies] notify-rust = "3"
- linux, with
- no windows support, yet
use notify_rust::Notification; Notification::new() .summary("Firefox News") .body("This will almost look like a real firefox notification.") .icon("firefox") .show().unwrap();
use notify_rust::Notification; use notify_rust::NotificationHint as Hint; Notification::new() .summary("Category:email") .body("This has nothing to do with emails.\nIt should not go away until you acknoledge it.") .icon("thunderbird") .appname("thunderbird") .hint(Hint::Category("email".to_owned())) .hint(Hint::Resident(true)) // this is not supported by all implementations .timeout(0) // this however is .show().unwrap();
Please see the documentation for current examples.
Checkout toastify, it exposes most of the functionality of the lib to the commandline.
This library shines on linux and bsd, which is it's original target platform.
Lately it gained support for macOS thanks to mac-notification-sys.
However this only includes a small subset of the current functionality, since
NSNotifications don't have as many features. Please refer to the You are a versed macOS UI developer with mad Objective-C skillz? PRSV.