blob: 7d087143784691b551e8e0d236af03f8694c33f4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
pub fn init() {
#[cfg(feature = "libnotify")]
libnotify::init("mumd").unwrap();
}
#[cfg(feature = "libnotify")]
pub fn send(msg: String) -> Option<bool> {
match libnotify::Notification::new("mumd", Some(msg.as_str()), None).show() {
Ok(_) => Some(true),
Err(_) => {
log::debug!("Unable to send notification");
Some(false)
}
}
}
#[cfg(not(feature = "libnotify"))]
pub fn send(_msg: String) -> Option<bool> {
None
}
|