Skip to content

Commit

Permalink
Fix title not clearing on empty workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
FieldofClay committed Sep 12, 2023
1 parent 8386d2f commit 67b09c5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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()
}

0 comments on commit 67b09c5

Please sign in to comment.