SHARE
TWEET

Untitled

a guest Sep 16th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top