Created attachment 237697 [details] [New Port] x11/py-autotiling: Automatically switch the window split orientation in sway and i3 This script uses the i3ipc-python library to switch the layout splith/splitv depending on the currently focused window dimensions. It works on both sway and i3 window managers. 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. Yes, it may make stacking and tabbed layouts behave oddly. No, nothing can be done about it. If you like stacking/tabbed layouts, you may use them on workspaces with autotiling turned off (--workspaces argument). Do not submit issues about it. Tested with Poudriere on armv7 arm64 i386 amd64 FreeBSD 13.1. Does not build with latest due to dependency affected by bug #267326.
Don't know about the utility of this program. On i3 we can just use: # split in horizontal orientation bindsym Mod1+h split h # split in vertical orientation bindsym Mod1+v split v and any keybinding to open windows with programs (terminals, etc)
(In reply to Nuno Teixeira from comment #1) The purpose of the program is that it automatically decides whether horizontal or vertical splitting is best in the current situation, so you don't have to decide yourself.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=29ffad78e36c430d4f01dc482a6e5282c92171d8 commit 29ffad78e36c430d4f01dc482a6e5282c92171d8 Author: Robert Clausecker <fuz@fuz.su> AuthorDate: 2022-11-11 20:25:24 +0000 Commit: Juraj Lutter <otis@FreeBSD.org> CommitDate: 2022-11-11 20:25:24 +0000 x11/py-autotiling: Add new port Automatically switch the window split orientation in sway and i3. This script uses the i3ipc-python library to switch the layout splith/splitv depending on the currently focused window dimensions. It works on both sway and i3 window managers. PR: 267408 x11/Makefile | 1 + x11/py-autotiling/Makefile (new) | 20 ++++++++++++++++++++ x11/py-autotiling/distinfo (new) | 3 +++ x11/py-autotiling/files/patch-setup.cfg (new) | 10 ++++++++++ x11/py-autotiling/pkg-descr (new) | 16 ++++++++++++++++ x11/py-autotiling/pkg-message (new) | 9 +++++++++ 6 files changed, 59 insertions(+)
Committed, thanks.