Is there a decent "tile all windows" i3 script?

asked 2015-10-03 15:14:57 +0000

moodboom gravatar image

updated 2015-10-09 00:24:20 +0000

I would like a new "container" for i3, in addition to the stacked, tabbed and h/v split containers. This container would display all the windows as tiled; that is, every window would be made as "square" as possible within the container. It would place the windows in a grid of equal-sized cells, but the last row might contain less than the rest. For example:

[ w1 ][ w2 ][ w3 ]

[ w4 ][ w5 ][ w6 ]

[ wide7 ][ wide8 ]

I realize this can be stitched together from split containers. But I'd either like the mode, or a script to auto-create a set of h/v split containers, so I can get there in one quick operation. I'd like it to take whatever containers are on the particular workspace, and replace them all with the tiled configuration.

I could script this but the devil is in the details so I thought I would see if someone else had scripted a solution they could share. Or an alternative solution? Thanks, viva la i3!!

edit retag flag offensive close merge delete

Comments

It should be fairly simple once you count the number of windows to move to calculate the size of the square. Just move all windows to a temporary workspace and after every n-th one, issue the commands "move down, split h".

Airblader gravatar imageAirblader ( 2015-10-03 19:15:04 +0000 )edit

Thanks Airblader, good tips, I suppose I could give it a try. Sorry but I can't upvote your comment or anything, this site is a little too locked down. :-)

moodboom gravatar imagemoodboom ( 2015-10-09 23:27:50 +0000 )edit

Argg, i started [https://github.com/MicahChambers/i3-wm-scripts here] but got errors out of the python scripts. Got any example python scripts? IndexError: list index out of range nextfind.py", line 44, in get_named_windows windows[results1.group(3).strip()].append(results1.group(1)) KeyError: '..

moodboom gravatar imagemoodboom ( 2015-10-10 00:08:53 +0000 )edit

OK I got nextmatch.py up and running, it's a start. :-)

moodboom gravatar imagemoodboom ( 2015-10-10 00:25:28 +0000 )edit