https://github.com/hyprland-community/hyprland-py
An unoffical async python wrapper for hyprland's IPC [maintainer=@flick0]
https://github.com/hyprland-community/hyprland-py
Last synced: about 1 month ago
JSON representation
An unoffical async python wrapper for hyprland's IPC [maintainer=@flick0]
- Host: GitHub
- URL: https://github.com/hyprland-community/hyprland-py
- Owner: hyprland-community
- Created: 2022-12-21T11:36:50.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-03T08:57:09.000Z (12 months ago)
- Last Synced: 2025-04-28T18:14:30.975Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 233 KB
- Stars: 59
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-hyprland - Hyprland-py
README
# Hyprland-py
An unofficial python wrapper for Hyprland's IPC- [x] event listener
- [x] change config options
- [x] hyprland info
- [x] dispatchers
- [ ] binds
- [x] window object
- [x] monitor object
- [x] workspace object
- [ ] handle color values
- [x] socket commands
- [ ] docs
- [ ] github action to update config options automagically# Install
### git
from git
```py
pip install git+https://github.com/hyprland-community/hyprland-py
```# Example
```py
import hyprland
import asynciohypr = hyprland.Events()
@hypr.on("connect")
async def on_connect():
print("Connected to the socket")@hypr.on("workspace")
async def on_workspace(data):
print(data)@hypr.on("activewindow")
async def on_activewindow(win_class,title):
print(win_class,title)print(hyprland.fetch_version())
async def main():
print(hyprland.fetch_workspaces())
await hypr.async_connect()
# print(hyprland.Workspace.from_id(1))print("starting")
config = hyprland.config.Default()
config.animations.enabled = Trueworkspace = hyprland.Workspace.from_id(1)
workspace.fetch_windows()# fetch all workspaces
hyprland.fetch_workspaces()asyncio.run(main())
```