Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script not working properly on ultrawide monitors? #51

Closed
juipeltje opened this issue Nov 11, 2023 · 15 comments
Closed

Script not working properly on ultrawide monitors? #51

juipeltje opened this issue Nov 11, 2023 · 15 comments

Comments

@juipeltje
Copy link

hello,

i'm using 2 ultrawide monitors and tried to use autotiling with sway, but the container never starts vertical splitting until a third column is opened, even when i run it with --limit 2. i'm assuming this has something to do with how the script determines when to split based on width/height, and the extra width of an ultrawide monitor probably messes that up. is there anything that can be done to solve that? i do use dynamic tilers to solve this, but i still love i3/sway as well, but the manual tiling is killing me lol.

@Syphdias
Copy link
Contributor

Hi @juipeltje, you are right; --limit is not the right tool for that. The way the script determines which way to split is by checking if the height of the window is bigger than the width.

new_layout = "splitv" if con.rect.height > con.rect.width else "splith"

So with an ultra wide (21:9) the first two windows will be roughly 10.5:9, so still wider than high, thus resulting not in changing the split and affecting the next window.
PR #44 aims to make it configurable which --splitratio.

@juipeltje
Copy link
Author

ah i see, thanks for explaining it. so the --splitratio feature still has to be implemented?

@nwg-piotr
Copy link
Owner

ah i see, thanks for explaining it. so the --splitratio feature still has to be implemented?

Yeah, sorry for making you wait. I still have too many things to remember. I'll try to get back to it soon.

@juipeltje
Copy link
Author

no worries, i was just a bit confused about whether it was implemented or not, but it's nice to hear that it's coming at some point in the future. i messed around with some other autotiling scripts that are out there as well, but they all seem to suffer from the same issues when used on an ultrawide monitor. in the meantime i'll try to get used to manual tiling 😅

@nwg-piotr
Copy link
Owner

Personally I don't expect it to resolve the widescreen issue, but it's easy to test. Open the merged version of the script, save somewhere on $PATH as e.g. test-autotiling, pkill -f autotiling and run the script you've just saved. Watch in the terminal what happens. Let me know.

@juipeltje
Copy link
Author

i just tried the merged script, but like you said, the behaviour is still the same. i'm not getting much output from the terminal other than

 Event.WINDOW subscribed
 Event.MODE subscribed

@nwg-piotr
Copy link
Owner

For more output use the --debug flag. Not that it's gonna tell us something useful, but you'll see what's going on.

@juipeltje
Copy link
Author

ah yes, i see it now, it indeed does not say anything usefull, i just realized though when you mentioned the flag, that i was running the new script without any flags at all. i just tried it again with --splitratio 1.61 and it does actually seem to fix the issue! it now starts autotiling when opening a third window in the second column as expected.

@nwg-piotr
Copy link
Owner

Give it a longer try, and then tell me your final opinion.

@juipeltje
Copy link
Author

alright, will do, i'll keep using it and see what happens.

@juipeltje
Copy link
Author

i just wanted to give a quick update after using the script for a few weeks now. so far i've only been using it with the splitratio 1.61 option and i've been alternating between using it with and without the --limit 2 option, to get a master stack and dwindle type layout. i haven't had any problems with it so far, but on two separate occasions it did spit out the following error in the terminal:

Error: 'NoneType' object has no attribute 'type'

so far i haven't been able to tell what triggers this error, since it only happened twice, but i thought maybe it was worth mentioning. i'm not entirely sure if that's a problem with the script or if i'm missing some sort of python module, cause i installed i3ipc in a python venv and use the script that way. this error hasn't had any effect on how the script functions from what i can tell. the autotiling still worked as expected even after the error.

@nwg-piotr
Copy link
Owner

If I understand well, you recommend to merge the changes, right?

@juipeltje
Copy link
Author

yes, i would say it's good to go. i haven't tested every single option it has because i wouldn't use them normally, but it hasn't given me any trouble and has been working perfectly so far.

@Nama
Copy link

Nama commented Feb 1, 2024

Came here looking for such a solution. The extra parameters look very useful, too.

@nwg-piotr
Copy link
Owner

Pending PR merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants