Skip to content

An unoffical async python wrapper for hyprland's IPC [maintainer=@flick0]

License

Notifications You must be signed in to change notification settings

aspizu/hyprland-py

 
 

Repository files navigation

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 .

About

An unoffical async python wrapper for hyprland's IPC [maintainer=@flick0]

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.8%
  • Shell 0.2%