Hyprland-rs

A unoffical rust wrapper for Hyprland's IPC
Getting started!
Lets get started with Hyprland-rs!
Adding to your project
Add the code below to the dependencies section of your Cargo.toml file!
hyprland = "0.1.1"
What this crate provides
This crate provides 3 modules (+1 for shared things)
data for getting information on the compositor
event_listener which provides the EventListener struct for listening for events
dispatch for calling dispatchers and changing keywords
Example Usage
here is an example of most of the provided features being utilized
use hyprland::data::get_monitors;
use hyprland::dispatch::{dispatch_blocking, Corner, DispatchType};
use hyprland::event_listener::EventListener;
fn main() -> std::io::Result<()> {
dispatch_blocking(DispatchType::Exec("kitty".to_string()))?;
dispatch_blocking(DispatchType::MoveCursorToCorner(Corner::TopLeft))?;
dispatch_blocking(DispatchType::Keyword(
"general:border_size".to_string(),
"30".to_string(),
))?;
let monitors = get_monitors();
println!("{monitors:#?}");
let mut event_listener = EventListener::new();
event_listener.add_workspace_change_handler(&|id| println!("workspace changed to {id:#?}"));
event_listener.start_listener_blocking()
}