diff --git a/apps/notifications/Cargo.toml b/apps/notifications/Cargo.toml index f4d240e..5f56a81 100644 --- a/apps/notifications/Cargo.toml +++ b/apps/notifications/Cargo.toml @@ -4,5 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] +canary-magpie = { path = "../magpie" } smol = "1.2" zbus = "3.5" diff --git a/apps/notifications/src/main.rs b/apps/notifications/src/main.rs index 7952499..dd59530 100644 --- a/apps/notifications/src/main.rs +++ b/apps/notifications/src/main.rs @@ -1,9 +1,15 @@ use std::collections::HashMap; use std::future::pending; +use canary_magpie::protocol::*; +use smol::net::unix::UnixStream; use zbus::{dbus_interface, zvariant::Value, ConnectionBuilder, SignalContext}; -pub struct Notifications {} +pub type MagpieClient = ClientMessenger; + +pub struct Notifications { + magpie: MagpieClient, +} #[dbus_interface(name = "org.freedesktop.Notifications")] impl Notifications { @@ -55,7 +61,10 @@ impl Notifications { pub fn main() { smol::block_on(async { - let notifications = Notifications {}; + let sock_path = find_socket(); + let socket = UnixStream::connect(sock_path).await.unwrap(); + let magpie = MagpieClient::new(socket); + let notifications = Notifications { magpie }; let _ = ConnectionBuilder::session() .unwrap()