-
Notifications
You must be signed in to change notification settings - Fork 6
/
example.py
38 lines (25 loc) · 702 Bytes
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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())