Crates.io | notifrust |
lib.rs | notifrust |
version | 3.5.0 |
source | src |
created_at | 2018-10-21 12:38:38.012703 |
updated_at | 2018-10-21 12:38:38.012703 |
description | A crate almost as good as notify-rust. |
homepage | |
repository | https://github.com/hoodie/notify-rust |
max_upload_size | |
id | 91817 |
size | 81,438 |
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.
#Cargo.toml
[dependencies]
notify-rust = "3"
rustc
>= 1.18.0libdbus-1
libdbus-1-dev
extern crate notify_rust;
use notify_rust::Notification;
Notification::new()
.summary("Firefox News")
.body("This will almost look like a real firefox notification.")
.icon("firefox")
.show().unwrap();
extern crate notify_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 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, however this only includes a small subset of the current functionality, since NSNotification
s don't have as many features. Please refer to the You are a versed macOS UI developer with mad Objective-C skillz? PRSV.