Skip to content

A Rust library for communicating with the yabai tiling window manager

License

Notifications You must be signed in to change notification settings

bigduu/yabai.rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yabai.rs

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

It sends client commands directly to the yabai server via UnixStream sockets, acting as a Rust equivalent of yabai -m.

Installation

Add the following to your Cargo.toml:

[dependencies]
yabai = "0.3.0"

or using cargo add:

cargo add yabai

Sending Commands

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(yabai::SpaceOption::Recent);

yabai::send_command(command)?;

Queries

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>

About

A Rust library for communicating with the yabai tiling window manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%