{"id":13419403,"url":"https://github.com/nwg-piotr/autotiling","last_synced_at":"2025-05-15T13:08:26.196Z","repository":{"id":40358185,"uuid":"210711922","full_name":"nwg-piotr/autotiling","owner":"nwg-piotr","description":"Script for sway and i3 to automatically switch the horizontal / vertical window split orientation","archived":false,"fork":false,"pushed_at":"2024-05-21T22:33:37.000Z","size":106,"stargazers_count":978,"open_issues_count":5,"forks_count":32,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-04-15T03:49:16.786Z","etag":null,"topics":["i3","i3-gaps","i3wm","sway","swaywm","tiling-extension","tiling-scripts"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nwg-piotr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"nwg-piotr","liberapay":"nwg"}},"created_at":"2019-09-24T22:58:34.000Z","updated_at":"2025-04-14T14:02:30.000Z","dependencies_parsed_at":"2024-01-13T19:38:37.421Z","dependency_job_id":"493ab663-229e-4c2a-a52e-57d104606d88","html_url":"https://github.com/nwg-piotr/autotiling","commit_stats":{"total_commits":91,"total_committers":14,"mean_commits":6.5,"dds":"0.48351648351648346","last_synced_commit":"9530ce3d52e635d3813d8a35d7ebf8e10798dda7"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwg-piotr%2Fautotiling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwg-piotr%2Fautotiling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwg-piotr%2Fautotiling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwg-piotr%2Fautotiling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwg-piotr","download_url":"https://codeload.github.com/nwg-piotr/autotiling/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i3","i3-gaps","i3wm","sway","swaywm","tiling-extension","tiling-scripts"],"created_at":"2024-07-30T22:01:15.517Z","updated_at":"2025-05-15T13:08:21.179Z","avatar_url":"https://github.com/nwg-piotr.png","language":"Python","funding_links":["https://github.com/sponsors/nwg-piotr","https://liberapay.com/nwg"],"categories":["Python","others"],"sub_categories":[],"readme":"# autotiling\nThis script uses the [i3ipc-python library](https://github.com/altdesktop/i3ipc-python)\nto switch the layout splith/splitv depending on the currently focused window\ndimensions. It works on both sway and i3 window managers.\n\nInspired by https://github.com/olemartinorg/i3-alternating-layout.\n\n## See on YouTube:\n\n[![Auto-tiling in\naction](https://img.youtube.com/vi/UWRZuhn92bQ/0.jpg)](https://www.youtube.com/watch?v=UWRZuhn92bQ)\n\n## PLEASE DO READ THIS\n\nThe script does one thing: it checks the window height / width ratio, and\nexecutes the equivalent of either `swaymsg splitv` or `swaymsg splith`. Nothing\nless, nothing more. This may make stack and tabbed layouts behave oddly.\nUnfortunately, there is nothing that can be done about it – please, do not\nsubmit issues about it –, but there are two workaround that you can try.\n\nOne option is, to enable autotiling on certain workspaces or outputs only.\nFor instance, you could configure autotiling to be enabled on odd workspaces,\nbut not on even ones:\n\n```text\n### Autostart\n  exec_always autotiling -w 1 3 5 7 9\n```\n\nAnother option you can try, is setting `--limit` and only use stacking or\ntabbing on the lowest level. A good place to start would be `--limit 2`. Open\nfour windows with the third and fourth window in the same container as two. This\nmight mimic a master-stack layout, and you should now be able to switch to\nstacking or tabbed. Beware that the decision on how to split is still based on\nthe height / width ratio.\n\n## Installation\n\nThe script has been packaged for the following distributions:\n\n [![Packaging\n status](https://repology.org/badge/vertical-allrepos/autotiling.svg)](https://repology.org/project/autotiling/versions)\n\n [![PyPI version](https://badge.fury.io/py/autotiling.svg)](https://badge.fury.io/py/autotiling)\n\nInstalling manually:\n\n1. Install the `python-i3ipc\u003e=2.0.1` package (or whatever it's called in your Linux\n    distribution);\n2. save the `main.py` file anywhere, rename to `autotiling`, make executable, move to your bin folder;\n3. add `exec_always autotiling` to the `~/.config/sway/config` or `exec_always --no-startup-id\n   autotiling` to the `~/.config/i3/config` file.\n\n## Usage\n\n```text\n$ autotiling -h\nusage: main.py [-h] [-d] [-v] [-o [OUTPUTS ...]] [-w [WORKSPACES ...]]\n               [-l LIMIT] [-sw SPLITWIDTH] [-sh SPLITHEIGHT] [-sr SPLITRATIO]\n               [-e [EVENTS ...]]\n\noptions:\n  -h, --help            show this help message and exit\n  -d, --debug           print debug messages to stderr\n  -v, --version         display version information\n  -o [OUTPUTS ...], --outputs [OUTPUTS ...]\n                        restricts autotiling to certain output; example:\n                        autotiling --output DP-1 HDMI-0\n  -w [WORKSPACES ...], --workspaces [WORKSPACES ...]\n                        restricts autotiling to certain workspaces; example:\n                        autotiling --workspaces 8 9\n  -l LIMIT, --limit LIMIT\n                        limit how often autotiling will split a container; try\n                        \"2\" if you like master-stack layouts; default: 0 (no\n                        limit)\n  -sw SPLITWIDTH, --splitwidth SPLITWIDTH\n                        set the width of the vertical split (as factor);\n                        default: 1.0;\n  -sh SPLITHEIGHT, --splitheight SPLITHEIGHT\n                        set the height of the horizontal split (as factor);\n                        default: 1.0;\n  -sr SPLITRATIO, --splitratio SPLITRATIO\n                        Split direction ratio - based on window height/width;\n                        default: 1;try \"1.61\", for golden ratio - window has\n                        to be 61% wider for left/right split; default: 1.0;\n  -e [EVENTS ...], --events [EVENTS ...]\n                        list of events to trigger switching split orientation;\n                        default: WINDOW MODE\n```\n\n### Events\n\nChanging event subscription has already been the objective of several pull request. To avoid doing this again and again,\nstarting from v1.6 you may specify them in the `-e` | `--events` argument. If no value given, the script will subscribe\nto `Event.WINDOW` and `Event.MODE`, as if it was executed with `autotiling -e WINDOW MODE`. See  \n[altdesktop/i3ipc-python`](https://github.com/altdesktop/i3ipc-python/blob/a670f24e7e04f509de8161cf760afe929c22ae93/i3ipc/events.py#L12) for event enumeration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwg-piotr%2Fautotiling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwg-piotr%2Fautotiling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwg-piotr%2Fautotiling/lists"}