#![allow(dead_code)]
extern crate rsnotifyos;
use rsnotifyos::RNotify;
use std::thread;
use std::time::Duration;
fn timeout(timeout: &i32)
{
let timeout_secs: u64 = *timeout as u64;
println!("Sleep 3.0 seconds\n Do not close");
thread::sleep(Duration::from_secs(timeout_secs));
}
fn main() {
println!("[+] Test System Notification");
#[cfg(target_os = "linux")]
{
println!("--- Test D-Bus Notification Send ----");
RNotify::dbus_notify("RNotification", "Notification", "Send Notification Rust", "dialog-information", &0, &1000);
timeout(&3);
println!("---- Test SubProcess Notication Send ----");
RNotify::cmd_notify("Rust", "dialog-information", "normal", "Send Notification Command using subprocess", "", "", 1000);
timeout(&3);
println!("--- Test Menssage Error Alert ----");
RNotify::alert("ERROR", "System Error Alert Menssage Event Loop");
timeout(&3);
println!("--- Test Menssage Information Alert ----");
RNotify::alert("info", "System Info Alert Menssage Event Loop");
}
#[cfg(target_os = "windows")]
{
println!("--- Test Menssage Error Alert ----");
RNotify::alert("ERROR", "System Error Alert Menssage Event Loop");
timeout(&3);
println!("--- Test Menssage Information Alert ----");
RNotify::alert("info", "System Info Alert Menssage Event Loop");
}
}