Skip to content
Discussion options

You must be logged in to vote

i wrote a tiny program

#!/usr/bin/env python3

from i3ipc.aio import Connection
import asyncio
import time


async def main():
    i3 = await Connection().connect()
    tree = await i3.get_tree()
    focused = tree.find_focused()
    if focused.workspace().name == "5":
        await i3.command("mode '_'")
        await i3.command("bar mode invisible")
    else:
        await i3.command("mode 'default'")
        await i3.command("bar mode hide")


if __name__ == "__main__":
    while True:
        asyncio.run(main())
        time.sleep(1)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@orestisfl
Comment options

@ghost
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant