File: reuse.rs

package info (click to toggle)
rust-notify-rust 4.11.6-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 604 kB
  • sloc: sh: 18; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 470 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use notify_rust::Notification;
fn main() {
    // here we create a notification and then reuse a second time

    let mut notification = Notification::new()
        .summary("News update")
        .icon("computer")
        .body("Something bad happened")
        .finalize();

    notification.show().unwrap();

    std::thread::sleep(std::time::Duration::from_millis(1500));

    notification.body("just kidding, nothing happened");
    notification.show().unwrap();
}