2015-03-07 12:55:19 +00:00
|
|
|
extern crate libnotify;
|
|
|
|
|
|
|
|
fn main() {
|
2015-11-03 09:06:33 +00:00
|
|
|
// Create a libnotify context
|
|
|
|
let notify = libnotify::Context::new("myapp").unwrap();
|
|
|
|
// Create a new notification and show it
|
2017-07-09 12:25:30 +00:00
|
|
|
let n = notify.new_notification("Summary", Some("Optional Body"), None)
|
|
|
|
.unwrap();
|
2015-11-03 09:06:33 +00:00
|
|
|
n.show().unwrap();
|
|
|
|
// You can also use the .show() convenience method on the context
|
|
|
|
notify.show("I am another notification", None, None).unwrap();
|
2015-03-07 12:55:19 +00:00
|
|
|
}
|