autotiling


Nameautotiling JSON
Version 1.9.3 PyPI version JSON
download
home_pagehttps://github.com/nwg-piotr/autotiling
SummaryAutomatically switch the horizontal/vertical window split orientation in sway and i3
upload_time2024-05-21 22:39:32
maintainerNone
docs_urlNone
authorPiotr Miller
requires_python>=3.6
licenseGPL-3.0-or-later
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # autotiling
This script uses the [i3ipc-python library](https://github.com/altdesktop/i3ipc-python)
to switch the layout splith/splitv depending on the currently focused window
dimensions. It works on both sway and i3 window managers.

Inspired by https://github.com/olemartinorg/i3-alternating-layout.

## See on YouTube:

[![Auto-tiling in
action](https://img.youtube.com/vi/UWRZuhn92bQ/0.jpg)](https://www.youtube.com/watch?v=UWRZuhn92bQ)

## PLEASE DO READ THIS

The script does one thing: it checks the window height / width ratio, and
executes the equivalent of either `swaymsg splitv` or `swaymsg splith`. Nothing
less, nothing more. This may make stack and tabbed layouts behave oddly.
Unfortunately, there is nothing that can be done about it – please, do not
submit issues about it –, but there are two workaround that you can try.

One option is, to enable autotiling on certain workspaces or outputs only.
For instance, you could configure autotiling to be enabled on odd workspaces,
but not on even ones:

```text
### Autostart
  exec_always autotiling -w 1 3 5 7 9
```

Another option you can try, is setting `--limit` and only use stacking or
tabbing on the lowest level. A good place to start would be `--limit 2`. Open
four windows with the third and fourth window in the same container as two. This
might mimic a master-stack layout, and you should now be able to switch to
stacking or tabbed. Beware that the decision on how to split is still based on
the height / width ratio.

## Installation

The script has been packaged for the following distributions:

 [![Packaging
 status](https://repology.org/badge/vertical-allrepos/autotiling.svg)](https://repology.org/project/autotiling/versions)

 [![PyPI version](https://badge.fury.io/py/autotiling.svg)](https://badge.fury.io/py/autotiling)

Installing manually:

1. Install the `python-i3ipc>=2.0.1` package (or whatever it's called in your Linux
    distribution);
2. save the `main.py` file anywhere, rename to `autotiling`, make executable, move to your bin folder;
3. add `exec_always autotiling` to the `~/.config/sway/config` or `exec_always --no-startup-id
   autotiling` to the `~/.config/i3/config` file.

## Usage

```text
$ autotiling -h
usage: main.py [-h] [-d] [-v] [-o [OUTPUTS ...]] [-w [WORKSPACES ...]]
               [-l LIMIT] [-sw SPLITWIDTH] [-sh SPLITHEIGHT] [-sr SPLITRATIO]
               [-e [EVENTS ...]]

options:
  -h, --help            show this help message and exit
  -d, --debug           print debug messages to stderr
  -v, --version         display version information
  -o [OUTPUTS ...], --outputs [OUTPUTS ...]
                        restricts autotiling to certain output; example:
                        autotiling --output DP-1 HDMI-0
  -w [WORKSPACES ...], --workspaces [WORKSPACES ...]
                        restricts autotiling to certain workspaces; example:
                        autotiling --workspaces 8 9
  -l LIMIT, --limit LIMIT
                        limit how often autotiling will split a container; try
                        "2" if you like master-stack layouts; default: 0 (no
                        limit)
  -sw SPLITWIDTH, --splitwidth SPLITWIDTH
                        set the width of the vertical split (as factor);
                        default: 1.0;
  -sh SPLITHEIGHT, --splitheight SPLITHEIGHT
                        set the height of the horizontal split (as factor);
                        default: 1.0;
  -sr SPLITRATIO, --splitratio SPLITRATIO
                        Split direction ratio - based on window height/width;
                        default: 1;try "1.61", for golden ratio - window has
                        to be 61% wider for left/right split; default: 1.0;
  -e [EVENTS ...], --events [EVENTS ...]
                        list of events to trigger switching split orientation;
                        default: WINDOW MODE
```

### Events

Changing event subscription has already been the objective of several pull request. To avoid doing this again and again,
starting from v1.6 you may specify them in the `-e` | `--events` argument. If no value given, the script will subscribe
to `Event.WINDOW` and `Event.MODE`, as if it was executed with `autotiling -e WINDOW MODE`. See  
[altdesktop/i3ipc-python`](https://github.com/altdesktop/i3ipc-python/blob/a670f24e7e04f509de8161cf760afe929c22ae93/i3ipc/events.py#L12) for event enumeration.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nwg-piotr/autotiling",
    "name": "autotiling",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Piotr Miller",
    "author_email": "nwg.piotr@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/06/3b/a03faee157a0b07c4cae7aaefada03739b2792fab86be41ff73ad88be1ce/autotiling-1.9.3.tar.gz",
    "platform": null,
    "description": "# 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 \u2013 please, do not\nsubmit issues about it \u2013, 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>=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",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "Automatically switch the horizontal/vertical window split orientation in sway and i3",
    "version": "1.9.3",
    "project_urls": {
        "Code": "https://github.com/nwg-piotr/autotiling",
        "Homepage": "https://github.com/nwg-piotr/autotiling",
        "Issues": "https://github.com/nwg-piotr/autotiling/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ae49aa898933e3ad8bb1edf2687708feccaefa46627ebac56858a3d74c7adb9a",
                "md5": "df3a19b3aa363296df2f0822b233554c",
                "sha256": "4d93443b36e278d2b67dc7d93e676f970a9dd0ee68f1a99d5c9ce7c1251e2264"
            },
            "downloads": -1,
            "filename": "autotiling-1.9.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "df3a19b3aa363296df2f0822b233554c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 19179,
            "upload_time": "2024-05-21T22:39:31",
            "upload_time_iso_8601": "2024-05-21T22:39:31.296155Z",
            "url": "https://files.pythonhosted.org/packages/ae/49/aa898933e3ad8bb1edf2687708feccaefa46627ebac56858a3d74c7adb9a/autotiling-1.9.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "063ba03faee157a0b07c4cae7aaefada03739b2792fab86be41ff73ad88be1ce",
                "md5": "37438a670ac0cc2d46ef0ed3885a0cf1",
                "sha256": "b286671106c8d68f0ae1f89e2cd49739ec944313423296763bb0bf7a14347027"
            },
            "downloads": -1,
            "filename": "autotiling-1.9.3.tar.gz",
            "has_sig": false,
            "md5_digest": "37438a670ac0cc2d46ef0ed3885a0cf1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 18128,
            "upload_time": "2024-05-21T22:39:32",
            "upload_time_iso_8601": "2024-05-21T22:39:32.361080Z",
            "url": "https://files.pythonhosted.org/packages/06/3b/a03faee157a0b07c4cae7aaefada03739b2792fab86be41ff73ad88be1ce/autotiling-1.9.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-21 22:39:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nwg-piotr",
    "github_project": "autotiling",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "autotiling"
}
        
Elapsed time: 0.72405s