Skip to content

Commit

Permalink
chore: hyprland-rs 0.4.0-beta.2
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-fff committed Jan 12, 2025
1 parent 1cd060a commit e18daf4
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 18 deletions.
135 changes: 128 additions & 7 deletions 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
Expand Up @@ -14,7 +14,7 @@ repository = "https://github.com/hyprland-community/hyprland-autoname-workspaces
[dependencies]
regex = "1"
clap = { version = "4.3.19", features = ["derive"] }
hyprland = { version = "=0.4.0-alpha.3" , features = ["silent"] }
hyprland = { version = "=0.4.0-beta.2" }
signal-hook = "0.3.17"
toml = { version = "0.7.6", features = ["indexmap", "preserve_order"] }
xdg = "2.5.2"
Expand Down
20 changes: 10 additions & 10 deletions src/renamer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::params::Args;
use formatter::*;
use hyprland::data::{Client, Clients, FullscreenMode, Workspace};
use hyprland::dispatch::*;
use hyprland::event_listener::{EventListener, WorkspaceDestroyedEventData};
use hyprland::event_listener::{EventListener, WorkspaceEventData};
use hyprland::prelude::*;
use hyprland::shared::Address;
use icon::{IconConfig, IconStatus};
Expand Down Expand Up @@ -163,19 +163,19 @@ impl Renamer {
rename_workspace_if!(
self,
event_listener,
add_window_open_handler,
add_window_close_handler,
add_window_opened_handler,
add_window_closed_handler,
add_window_moved_handler,
add_active_window_change_handler,
add_active_window_changed_handler,
add_workspace_added_handler,
add_workspace_moved_handler,
add_workspace_change_handler,
add_fullscreen_state_change_handler,
add_window_title_change_handler
add_workspace_changed_handler,
add_fullscreen_state_changed_handler,
add_window_title_changed_handler
);

let this = self.clone();
event_listener.add_workspace_destroy_handler(move |wt| {
event_listener.add_workspace_deleted_handler(move |wt| {
_ = this.rename_workspace();
_ = this.remove_workspace(wt);
});
Expand Down Expand Up @@ -217,9 +217,9 @@ impl Renamer {

fn remove_workspace(
&self,
wt: WorkspaceDestroyedEventData,
wt: WorkspaceEventData,
) -> Result<bool, Box<dyn Error + '_>> {
Ok(self.known_workspaces.lock()?.remove(&wt.workspace_id))
Ok(self.known_workspaces.lock()?.remove(&wt.id))
}
}

Expand Down

0 comments on commit e18daf4

Please sign in to comment.