Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 1.14 KB

README.md

File metadata and controls

66 lines (48 loc) · 1.14 KB

Hyprland-py

An unofficial python wrapper for Hyprland's IPC

  • event listener
  • change config options
  • hyprland info
  • dispatchers
  • binds
  • window object
  • monitor object
  • workspace object
  • handle color values
  • socket commands
  • docs
  • github action to update config options automagically

Install

git

from git

pip install git+https://github.com/hyprland-community/hyprland-py

Example

import hyprland
import asyncio

hypr = 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 = True


workspace = hyprland.Workspace.from_id(1)
workspace.fetch_windows()

# fetch all workspaces
hyprland.fetch_workspaces()

asyncio.run(main())