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.
```toml
[dependencies] notify-rust = "3.0" ```
rust
use notify_rust::Notification;
use notify_rust::NotificationHint as Hint;
Notification::new()
.summary("Firefox News")
.body("This will almost look like a real firefox notification.")
.icon("firefox")
.timeout(6000) //milliseconds
.show().unwrap();
rust
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 untill 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 ./notify-cli, it exposes most of the functionality of the lib to the commandline.
``` $ ./target/debug/notify send --help notify-send Shows a notification
USAGE:
notify send [FLAGS] [OPTIONS] [ARGS]
FLAGS: -d, --debug Also prints notification to stdout -h, --help Prints help information -V, --version Prints version information
OPTIONS:
-a, --app-name
ARGS: summary Title of the Notification. body Message body
```