Crate yabai

Source
Expand description

A Rust crate for communicating with the yabai tiling window manager.

§Examples:

Send a command as a string:

yabai::send("--focus space 2");

Send a command using the yabai::Command type:

let command: yabai::Command = yabai::Command::FocusSpace(yabai::SpaceOption::Recent);
yabai::send_command(command)?;

Query yabai for display information:

let displays = yabai::query_displays()?;

Structs§

DisplayInfo
Information about a display.
Frame
A rectangle representing the position and size of a window or display.
SpaceInfo
Information about a mission control space.
WindowInfo
Information about a window.

Enums§

Command
An enum representing a command that can be sent to yabai.
Direction
An enum representing a cardinal direction.
FocusSpaceOption
An enum representing the options passed to the space --focus command.
SpaceRotation
An enum representing the options passed to the space --rotate command.
YabaiError
The main error type for errors returned by this crate.

Functions§

focus_space
focus_window
query_displays
Queries yabai for information about all displays.
query_spaces
Queries yabai for information about all spaces.
query_windows
Queries yabai for information about all windows.
send
Send a command to yabai as a string of space-separated arguments.
send_command
Send a yabai::Command to yabai.