use dbus::blocking::Connection;
use dbus::message::Message;
use std::collections::HashMap;
+use std::process::Command;
use std::sync::{Arc, Mutex};
use std::time::Duration;
let clone_arc = arc_map.clone();
let mut map = clone_arc.lock().unwrap();
map.insert(String::from(key), String::from(val));
- for (k, v) in &*map {
- println! {"{}: {}", k.clone(), v.clone()};
- }
+ let _ = Command::new("xsetroot")
+ .arg("-name")
+ .arg(format!(
+ "[🔊 {title} - {artist}] | ✉ {unread_count}",
+ title = map.get("title").unwrap_or(&String::from("")),
+ artist = map.get("artist").unwrap_or(&String::from("")),
+ unread_count = map.get("unread_count").unwrap_or(&String::from("?")),
+ ))
+ .spawn();
}
fn main() -> Result<(), Box<dyn std::error::Error>> {