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:
parent
3dc198ee41
commit
8371a92204
6 changed files with 139 additions and 96 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue