Created
September 5, 2019 11:07
-
-
Save zetxx/ddbd7ffca620f34d9b88f596479f8346 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment