Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. from typing import Awaitable
  2. import asyncio
  3. import i3ipc
  4. import threading
  5.  
  6. def pollTitle(c):
  7. # i3.get_tree().find_focused().name
  8. print(c.get_tree().find_focused().window_class)
  9.  
  10. async def run() -> Awaitable[str]:
  11. i3 = i3ipc.Connection()
  12. i3.on("window", lambda _p_i3, _p_e: pollTitle(_p_i3))
  13. threading.Thread(target=i3.main).start()
  14.  
  15. asyncio.run(run())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement