Crates.io | yabai |
lib.rs | yabai |
version | 0.5.0 |
source | src |
created_at | 2023-04-08 07:45:12.30075 |
updated_at | 2024-03-31 17:05:09.192422 |
description | A crate for communicating with the yabai tiling window manager. |
homepage | |
repository | https://github.com/sudosilico/yabai.rs/ |
max_upload_size | |
id | 833483 |
size | 24,436 |
A Rust library for communicating with the yabai tiling window manager's ipc socket, acting as a Rust equivalent of the yabai -m
command.
Add the following to your Cargo.toml
:
[dependencies]
yabai = "0.5.0"
or using cargo add
:
cargo add yabai
You can send commands in a yabai -m
like fashion, using a string:
yabai::send("--focus space 2");
Alternatively, you can use the Command
enum for more strongly-typed inputs:
let command = yabai::Command::FocusSpace { option: yabai::SpaceOption::Recent };
yabai::send_command(command)?;
Displays, spaces, and windows can all be queried:
let displays = yabai::query_displays()?; // Vec<DisplayInfo>
let spaces = yabai::query_spaces()?; // Vec<SpaceInfo>
let windows = yabai::query_windows()?; // Vec<WindowInfo>
"python"
- Adds pyo3
derive attributes to yabai command enums.