#hyprland #ipc #command #filter #channel

hyprrust

A crate that provides an interface with the Hyprland sockets

1 unstable release

0.1.0 Mar 10, 2025

#20 in #commands

Download history 101/week @ 2025-03-06 28/week @ 2025-03-13

129 downloads per month

Custom license

67KB
2K SLoC

Hyprrust

A crate that provides a rust interface to communicate with the Hyprland sockets.

While there are other crates that are used to communicate with the Hyprland sockets, this one might stand out because of:

  • Ability to connect to more hyprland sockets/instances
  • Ability to implement your own Hyprland commands
  • Events can be received through an async channel
  • Batching commands
  • Filtering commands (both exclusion and inclusion filters)

Get started

To start, add this crate to your project:

cargo add hyprrust

Look at the examples.

And read the documentation.


lib.rs:

A crate that provides a rust interface to communicate with the Hyprland sockets.

There are two types of Hyprland sockets, one used for events and one used for commands or to request data (ie. clients, decorations, etc.)

The main struct of this crate is HyprlandConnection. It's used for connecting to both sockets (except when you need sync events, in which case you should use DetachedEventConnection).

Crate overview

Get started

By default, this crate enables both the sync and async features. It's preferred to disable default features and include only the sync feature if you don't need async, this way tokio is not included.

To get started add this crate to your project:

cargo add hyprrust

Module structure

This crate conatins several modules:

  • commands All implemented commands, but doesn't include arguments.
  • commands::prelude All commands and arguments.
  • data All commands used to request data from Hyprland.
  • errors All errors returned by the API of this library.
  • events Contains everything needed to receive sync and async events and filter them.

Examples

See the examples folder in the crates source.

Dependencies

~2–11MB
~130K SLoC