2015-03-07 12:55:19 +00:00
|
|
|
extern crate libnotify;
|
|
|
|
|
|
|
|
fn main() {
|
2017-07-09 23:01:36 +00:00
|
|
|
// Init libnotify
|
2017-07-10 21:21:16 +00:00
|
|
|
libnotify::init("myapp");
|
2017-07-11 12:36:21 +00:00
|
|
|
// Create a new notification (doesn't show it yet)
|
2017-07-09 23:09:21 +00:00
|
|
|
let n =
|
2017-07-10 21:21:16 +00:00
|
|
|
libnotify::Notification::new("Summary", Some("Optional Body"), None);
|
2017-07-09 23:01:36 +00:00
|
|
|
// Show the notification
|
2015-11-03 09:06:33 +00:00
|
|
|
n.show().unwrap();
|
2017-07-11 13:18:40 +00:00
|
|
|
// Update the existent notification
|
2017-07-09 23:01:36 +00:00
|
|
|
n.update("I am another notification", None, None).unwrap();
|
2017-07-11 13:18:40 +00:00
|
|
|
// Show the updated notification
|
2017-07-09 23:01:36 +00:00
|
|
|
n.show().unwrap();
|
|
|
|
// We are done, deinit
|
|
|
|
libnotify::uninit();
|
2015-03-07 12:55:19 +00:00
|
|
|
}
|