Expand description
§Hyprland-rs
An unofficial rust wrapper for Hyprland’s IPC
§Disclaimer
If something doesn’t work, doesn’t matter what, make sure you are on the latest version (or commit) of Hyprland before making an issue!
§Getting started!
Let’s get started with Hyprland-rs!
§Adding to your project
Add the code below to the dependencies section of your Cargo.toml file!
hyprland = "0.3.12"
§Reading the docs
Hyprland-rs has a ton of types (and some really long ones)! Its important you know how the ones you will be using work! The docs can be found at docs.rs/hyprland
§Master version
If Hyprland-rs is broken (or other reason) and is taking too long for a release to come out,
you can use the master branch in Cargo (will not allow the crate to be published to crates.io
):
hyprland = { git = "https://github.com/hyprland-community/hyprland-rs", branch = "master" }
§What this crate provides
This crate provides 6 modules (+1 for shared things)
data
for getting information on the compositorevent_listener
which provides theEventListener
struct for listening for eventsdispatch
for calling dispatcherskeyword
for dealing with config option (aka keywords)config::binds
for changing binds (in futureconfig
might have config generation)ctl
for calling hyprctl commands
§Example Usage
Check the examples in the examples
directory
Modules§
- config
- This module provides helpers to easily config Hyprland
- ctl
- This module is for calling hyprctl commands, for getting data use data
- data
- This module provides functions for getting information on the compositor
- dispatch
- This module is for calling dispatchers and changing keywords
- event_
listener - This module provides the EventListener struct for listening and acting upon for events
- keyword
- This module provides the stuff needed to mutate, and read Hyprland config values
- prelude
- The prelude module, this is to import all traits
- shared
- This module provides shared things throughout the crate
Macros§
- async_
closure - Creates a async closure
- bind
- Macro abstraction over Binder
- command
- Creates a
CommandContent
instance with the given flag and formatted data. - dispatch
- Macro abstraction over Dispatch::call
Type Aliases§
- Result
- This type provides the result type used everywhere in Hyprland-rs