aboutsummaryrefslogtreecommitdiffstats
path: root/mumd
diff options
context:
space:
mode:
Diffstat (limited to 'mumd')
-rw-r--r--mumd/src/notify.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/mumd/src/notify.rs b/mumd/src/notify.rs
new file mode 100644
index 0000000..5bb1a26
--- /dev/null
+++ b/mumd/src/notify.rs
@@ -0,0 +1,19 @@
+use log::*;
+
+pub fn init() {
+ libnotify::init("mumd").unwrap();
+}
+
+pub fn send(msg: String) -> bool {
+ match libnotify::Notification::new(
+ "mumd",
+ Some(msg.as_str()),
+ None,
+ ).show() {
+ Ok(_) => { true }
+ Err(_) => {
+ debug!("Unable to send notification");
+ false
+ }
+ }
+}