An unofficial type-safe, async API wrapper for Hyprland's IPC for Python.
import asyncio
from hyprland import (
Exec,
Exit,
Key,
KillActive,
Mod,
MoveToWorkspace,
SwitchWorkspace,
WorkspaceID,
)
from hyprland.asyncio import execute_batch
async def main():
await execute_batch(
(Mod.SUPER + Key("M")).bind(Exit()),
(Mod.SUPER + Key("Return")).bind(Exec("wezterm")),
(Mod.SUPER + Key("Q")).bind(KillActive()),
*((Mod.SUPER + Key(i)).bind(SwitchWorkspace(WorkspaceID(i))) for i in range(1, 11)),
*((Mod.SUPER + Mod.SHIFT + Key(i)).bind(MoveToWorkspace(WorkspaceID(i))) for i in range(1, 11)),
)
asyncio.run(main())
View the full documentation in docs/hyprland/.
- msgspec for JSON parsing.
git clone https://github.com/aspizu/hyprland-py
cd hyprland-py
pip install -r requirements.txt
pip install .
From PyPI
pip install hyprland
git clone https://github.com/aspizu/hyprland-py
cd hyprland-py
git submodule init
git submodule update
pip install -r requirements.txt
./build.sh
pip install -e .