diff --git a/Cargo.lock b/Cargo.lock index 4d5af53..f31cc25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,7 +206,7 @@ dependencies = [ [[package]] name = "hyprland-activewindow" -version = "0.4.2" +version = "0.4.3" dependencies = [ "hyprland", "serde", diff --git a/Cargo.toml b/Cargo.toml index 23c83fb..9b6ab6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hyprland-activewindow" -version = "0.4.2" +version = "0.4.3" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src/main.rs b/src/main.rs index 5d8b60e..f7d30d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -82,6 +82,7 @@ fn main() -> Result<()> { // Create a event listener let mut event_listener = EventListener::new(); let mon2 = mon.clone(); + let mon3 = mon.clone(); event_listener.add_active_window_change_handler(move |_, state| { if mon.eq(&state.active_monitor) { print_title(&mon); @@ -96,6 +97,13 @@ fn main() -> Result<()> { print_all(); } }); + event_listener.add_workspace_change_handler(move |_, state| { + if mon3.eq(&state.active_monitor) { + print_title(&mon3); + } else if mon3 == "_" { + print_all(); + } + }); event_listener.start_listener() }