use zbus::blocking::Connection; use zbus::fdo::Result; use zbus::Message; use zbus::MatchRule; fn main() -> Result<()> { // Establish a connection to the session bus let connection = Connection::session()?; // Define a match rule for the notifications let match_rule = MatchRule::builder() .msg_type(zbus::MessageType::Signal) .interface("org.freedesktop.Notifications")? .path("/org/freedesktop/Notifications")? .build(); // Add the match rule to the connection connection.add_match(match_rule)?; // Process notifications loop { let message = connection.receive_message()?; if let Some(member) = message.member() { if member.as_str() == "Notify" { println!("Received a notification: {:?}", message); } } } }