diff --git a/src/icons.rs b/src/icons.rs index b6e086e..091ab33 100644 --- a/src/icons.rs +++ b/src/icons.rs @@ -2583,6 +2583,7 @@ lazy_static! { m.insert("hot".to_string(), '\u{f134}'); m.insert("rescue".to_string(), '\u{f134}'); m.insert("firefox".to_string(), '\u{f269}'); + m.insert("firefoxdeveloperedition".to_string(), '\u{f269}'); m.insert("browser".to_string(), '\u{f269}'); m.insert("firefox-browser".to_string(), '\u{f907}'); m.insert("browser".to_string(), '\u{f907}'); diff --git a/src/main.rs b/src/main.rs index adeca52..9940ee1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,28 +93,38 @@ fn rename_workspaces() { } fn main() { - // First set the correct names for the first time - rename_workspaces(); - // Then listen to window events and update names when necessary - let mut listener = I3EventListener::connect().unwrap(); - let subs = [Subscription::Window]; - listener.subscribe(&subs).unwrap(); + // Loop so that when i3 restarts it keeps working + // TODO: This might get out of hand, maybe + // add a sleep before restarting? + loop { + // Then listen to window events and update names when necessary + let mut listener = match I3EventListener::connect() { + Ok(listener) => listener, + Err(_) => continue + }; - for event in listener.listen() { - match event.unwrap() { - Event::WindowEvent(e) => match e.change { - WindowChange::New => { - rename_workspaces(); - } - WindowChange::Close => { - rename_workspaces(); - } - WindowChange::Move => { - rename_workspaces(); - } - _ => (), - }, - _ => unreachable!(), + let subs = [Subscription::Window]; + listener.subscribe(&subs).unwrap(); + + // First set the correct names for the first time + rename_workspaces(); + + for event in listener.listen() { + match event { + Ok(Event::WindowEvent(e)) => match e.change { + WindowChange::New => { + rename_workspaces(); + } + WindowChange::Close => { + rename_workspaces(); + } + WindowChange::Move => { + rename_workspaces(); + } + _ => (), + }, + _ => break, + } } } }