diff options
| author | Gustav Sörnäs <gustav@sornas.net> | 2020-10-29 15:04:12 +0100 |
|---|---|---|
| committer | Gustav Sörnäs <gustav@sornas.net> | 2020-10-29 21:27:28 +0100 |
| commit | 69ec88d3fc2e3762cf596bbf0226b204ba35d874 (patch) | |
| tree | e15a627b117c1193f57ad7d88348320ffb3ef126 /mumd | |
| parent | bddf2324b1fd1c440127432cbd93ac64afc7ca85 (diff) | |
| download | mum-69ec88d3fc2e3762cf596bbf0226b204ba35d874.tar.gz | |
add file
Diffstat (limited to 'mumd')
| -rw-r--r-- | mumd/src/notify.rs | 19 |
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 + } + } +} |
