From a72869f115d8abafe5e302381d090ce3ccb4fa2e Mon Sep 17 00:00:00 2001 From: FieldofClay <7278759+FieldofClay@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:11:22 +1100 Subject: [PATCH] Added listener for window title change --- Cargo.lock | 2 +- Cargo.toml | 4 ++-- src/main.rs | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 89a6084..ec5b5a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -281,7 +281,7 @@ dependencies = [ [[package]] name = "hyprland-activewindow" -version = "1.0.0" +version = "1.0.1" dependencies = [ "flexi_logger", "hyprland", diff --git a/Cargo.toml b/Cargo.toml index 0938475..fc8951c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ repository = "https://github.com/FieldofClay/hyprland-activewindow" readme = "README.md" keywords = ["hyprland", "eww"] categories = ["command-line-utilities"] -version = "1.0.0" +version = "1.0.1" edition = "2021" license = "MIT" @@ -17,4 +17,4 @@ hyprland = "0.3.13" serde_json = "1.0" serde = "1.0" flexi_logger = "0.28" -log = "0.4" \ No newline at end of file +log = "0.4" diff --git a/src/main.rs b/src/main.rs index aee5854..0c07108 100644 --- a/src/main.rs +++ b/src/main.rs @@ -154,6 +154,10 @@ fn main() -> Result<()> { event_listener.add_window_moved_handler(move |_, _| { print(&mon_clone); }); + let mon_clone = Arc::clone(&mon); + event_listener.add_window_title_change_handler(move |_, _| { + print(&mon_clone); + }); event_listener.start_listener() }