blob: eaed3dc57e5a6d4641d345350e1bc1931d6a9e76 (
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(any(feature = "notifications", feature = "all"))]
libnotify::init("mumd").unwrap();
}
#[cfg(any(feature = "notifications", feature = "all"))]
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(any(feature = "notifications", feature = "all")))]
pub fn send(_: String) -> Option<bool> {
None
}
|