1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-03 11:41:04 +02:00

feat: load bars on monitor when it connects

Finally, Ironbar will respond to events of monitors being (dis)connected, and will create bars when a monitor connects.

This means at last - resolves #291

yaay
This commit is contained in:
Jake Stanger 2024-01-11 23:22:18 +00:00
parent 3dc198ee41
commit 8371a92204
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
6 changed files with 139 additions and 96 deletions

View file

@ -116,12 +116,24 @@ impl Ipc {
}
Command::Reload => {
info!("Closing existing bars");
ironbar.bars.borrow_mut().clear();
let windows = application.windows();
for window in windows {
window.close();
}
*ironbar.bars.borrow_mut() = crate::load_interface(application, ironbar.clone());
let wl = ironbar.clients.borrow_mut().wayland();
let outputs = wl.output_info_all();
ironbar.reload_config();
for output in outputs {
match crate::load_output_bars(ironbar, application, output) {
Ok(mut bars) => ironbar.bars.borrow_mut().append(&mut bars),
Err(err) => error!("{err:?}"),
}
}
Response::Ok
}