Crate i3wsr_core

Source
Expand description

§i3wsr - i3/Sway Workspace Renamer

Internal library functionality for the i3wsr binary. This crate provides the core functionality for renaming i3/Sway workspaces based on their content.

§Note

This is primarily a binary crate. The public functions and types are mainly exposed for:

  • Use by the binary executable
  • Testing purposes
  • Internal organization

While you could technically use this as a library, it’s not designed or maintained for that purpose.

Re-exports§

pub use config::Config;

Modules§

config
regex

Enums§

AppError

Statics§

VERBOSE
Global flag to control debug output verbosity.

Functions§

collect_titles
Collect a vector of workspace titles, recursively traversing all nested nodes
get_title
Gets a window title by trying to find an alias for the window, eventually falling back on class, or app_id, depending on platform.
get_workspaces
Filters out special workspaces (like scratchpad) and collects regular workspaces from the window manager tree structure.
handle_window_event
Processes various window events (new, close, move, title changes) and updates workspace names accordingly. This is a core part of the event loop in the main binary.
handle_ws_event
Processes workspace events (empty, focus changes) and updates workspace names as needed. This is a core part of the event loop in the main binary.
update_tree
Internal function to update all workspace names based on their current content. This function is public for testing purposes and binary use only.