+use dbus::blocking::stdintf::org_freedesktop_dbus::PropertiesPropertiesChanged;
+use dbus::blocking::Connection;
+use dbus::message::Message;
+use std::time::Duration;
+
+fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let conn = Connection::new_session()?;
+
+ let proxy = conn.with_proxy(
+ "org.mpris.MediaPlayer2.spotify",
+ "/org/mpris/MediaPlayer2",
+ Duration::from_millis(5000),
+ );
+
+ let _ = proxy.match_signal(
+ |pc: PropertiesPropertiesChanged, _: &Connection, _: &Message| {
+ println! {"dumping {:#x?}", pc.changed_properties["Metadata"]};
+ true
+ },
+ );
+
+ loop {
+ conn.process(Duration::from_millis(1000))?;
+ }
+}