|  | @@ -3,15 +3,14 @@ mod netspeed;
 | 
	
		
			
				|  |  |  mod comm;
 | 
	
		
			
				|  |  |  mod config;
 | 
	
		
			
				|  |  |  mod external;
 | 
	
		
			
				|  |  | +mod bar;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  use comm::{Channel, Message};
 | 
	
		
			
				|  |  |  use config::Config;
 | 
	
		
			
				|  |  | -use std::io::Write;
 | 
	
		
			
				|  |  |  use std::collections::HashMap;
 | 
	
		
			
				|  |  |  use std::sync::Arc;
 | 
	
		
			
				|  |  |  use std::sync::mpsc;
 | 
	
		
			
				|  |  |  use std::thread;
 | 
	
		
			
				|  |  | -use std::process;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  fn main() {
 | 
	
		
			
				|  |  |      let cfg = config::load("./panel.toml");
 | 
	
	
		
			
				|  | @@ -22,15 +21,8 @@ fn main() {
 | 
	
		
			
				|  |  |      make_thread(&tx, &cfg, sensors::sensors);
 | 
	
		
			
				|  |  |      make_thread(&tx, &cfg, netspeed::netspeed);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    let bar = process::Command::new("lemonbar")
 | 
	
		
			
				|  |  | -        .arg("-f")
 | 
	
		
			
				|  |  | -        .arg("Inconsolatazi4:size=12")
 | 
	
		
			
				|  |  | -        .stdin(process::Stdio::piped())
 | 
	
		
			
				|  |  | -        .spawn()
 | 
	
		
			
				|  |  | -        .ok()
 | 
	
		
			
				|  |  | -        .expect("Failed to start lemonbar");
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -    let mut output = bar.stdin.unwrap();
 | 
	
		
			
				|  |  | +    let mut topbar = bar::Bar::new(true);
 | 
	
		
			
				|  |  | +    let mut botbar = bar::Bar::new(false);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      let mut data = HashMap::new();
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -40,11 +32,12 @@ fn main() {
 | 
	
		
			
				|  |  |          match msg {
 | 
	
		
			
				|  |  |              Message { kind, text } => data.insert(kind, text),
 | 
	
		
			
				|  |  |          };
 | 
	
		
			
				|  |  | -        writeln!(&mut output, "{}%{{r}}{} | {}",
 | 
	
		
			
				|  |  | +        topbar.send(&format!("{}%{{r}}{} | {}",
 | 
	
		
			
				|  |  |              data.get("title").unwrap_or(&empty),
 | 
	
		
			
				|  |  |              data.get("netspeed").unwrap_or(&empty),
 | 
	
		
			
				|  |  |              data.get("sensors").unwrap_or(&empty)
 | 
	
		
			
				|  |  | -        ).ok();
 | 
	
		
			
				|  |  | +        ));
 | 
	
		
			
				|  |  | +        botbar.send(&format!("{}", data.get("cmus").unwrap_or(&empty)));
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 |