Skip to content

Latest commit

 

History

History
83 lines (61 loc) · 1.94 KB

README.md

File metadata and controls

83 lines (61 loc) · 1.94 KB

Hyprland for Python

GitHub repo size Ruff

An unofficial type-safe, async API wrapper for Hyprland's IPC for Python.

Examples

examples/flicko.py

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())

Documentation

View the full documentation in docs/hyprland/.

Install

Dependencies:

From source

git clone https://github.com/aspizu/hyprland-py
cd hyprland-py
pip install -r requirements.txt
pip install .

From PyPI

pip install hyprland

Development

Development dependencies:

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 .