1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
#[cfg(any(target_os = "windows", target_os = "macos"))]
fn main() {
println!("this is an xdg only feature")
}
#[cfg(all(unix, not(target_os = "macos",)))]
fn main() -> Result<(), Box<dyn std::error::Error>> {
use notify_rust::Notification;
std::env::set_var(
"RUST_LOG",
"simple=trace,zbus=trace,server=trace,notify_rust=trace",
);
#[cfg(feature = "env_logger")]
env_logger::init();
#[allow(deprecated)]
Notification::at_bus("example")
.summary("Critical Error")
.body("Just <b>kidding</b>, this is just the notification (example).")
.icon("dialog-error")
.show()?;
Ok(())
}
|