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