Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from typing import Awaitable
- import asyncio
- import i3ipc
- import threading
- def pollTitle(c):
- # i3.get_tree().find_focused().name
- print(c.get_tree().find_focused().window_class)
- async def run() -> Awaitable[str]:
- i3 = i3ipc.Connection()
- i3.on("window", lambda _p_i3, _p_e: pollTitle(_p_i3))
- threading.Thread(target=i3.main).start()
- asyncio.run(run())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement