| 1 | #![allow(unused_imports)] |
| 2 | mod common; |
| 3 | |
| 4 | fn main() { |
| 5 | if !common::setup(file!()) { |
| 6 | return; |
| 7 | } |
| 8 | |
| 9 | use notify_rust::{CloseReason, Hint, Notification, Timeout}; |
| 10 | use std::thread; |
| 11 | |
| 12 | Notification::new() |
| 13 | .summary("Time is running out") |
| 14 | .body("Main Thread Notification") |
| 15 | .icon("clock") |
| 16 | .timeout(Timeout::Milliseconds(5000)) |
| 17 | .show() |
| 18 | .unwrap() |
| 19 | .on_close(|reason| log::info!("❎ fg notification was closed ({reason:?})")); |
| 20 | |
| 21 | common::run_main_loop_while(thread::spawn(|| { |
| 22 | Notification::new() |
| 23 | .summary("Time is running out") |
| 24 | .body("BG Thread Notification") |
| 25 | .icon("clock") |
| 26 | .show() |
| 27 | .unwrap() |
| 28 | .on_close(|reason| log::info!("❎ bg notification was closed ({reason:?})")); |
| 29 | })) |
| 30 | .unwrap(); |
| 31 | } |