Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 2 months 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
- License: mit
- Created: 2022-12-21T11:36:50.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-21T15:50:59.000Z (about 1 year ago)
- Last Synced: 2024-03-14T15:12:44.637Z (10 months ago)
- Language: Python
- Homepage:
- Size: 204 KB
- Stars: 35
- Watchers: 3
- Forks: 4
- 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())
```