rust-libnotify/examples/show.rs

13 lines
447 B
Rust
Raw Normal View History

extern crate libnotify;
fn main() {
let notify = libnotify::Context::new("hello").unwrap_or_else(|e| {
panic!("{}", e);
});
let body_text = Some("This is the optional body text.");
2015-03-08 16:14:52 +00:00
let n = notify.new_notification("This is the summary.",
body_text,
None).unwrap_or_else(|e| panic!("{}", e));
n.show().ok().expect("Failed to show notification");
}