Created
February 22, 2023 22:37
-
-
Save lukateras/78d9d3dcbf40dbda147573bd12cad147 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env python3 | |
import asyncio | |
import i3ipc.aio as swayipc | |
async def main(): | |
sway = await swayipc.Connection().connect() | |
tree = await sway.get_tree() | |
focused_workspace = tree.find_focused().workspace() | |
for leaf in focused_workspace.leaves(): | |
print('{x},{y} {width}x{height}'.format(**vars(leaf.rect))) | |
if __name__ == '__main__': | |
asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment