Skip to content

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

Notifications You must be signed in to change notification settings

hyprland-community/hyprland-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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