use std::{process::exit, thread::sleep, time::Duration as StdDuration};
use tauri_winrt_notification::{Duration, Sound, Toast};
fn main() {
Toast::new(Toast::POWERSHELL_APP_ID)
.title("Look at this flip!")
.text1("(╯°□°)╯︵ ┻━┻")
.sound(Some(Sound::SMS))
.duration(Duration::Short)
.on_activated(move |action| -> windows::core::Result<()> {
match action {
Some(action) => println!("You've clicked {}!", action),
None => println!("You've clicked me!"),
}
exit(0);
})
.add_button("Yes", "yes")
.add_button("No", "no")
.show()
.expect("unable to send notification");
println!("Waiting 10 seconds for the notification to be clicked...");
sleep(StdDuration::from_secs(10));
println!("The notification wasn't clicked!");
}