olemartinorg / i3-alternating-layout

Scripts to open new windows in i3wm using alternating layouts (splith/splitv) for each new window
MIT License
351 stars 41 forks source link

Workaround for broken pipe error in pyi3 #22

Closed neilbags closed 4 years ago

neilbags commented 4 years ago

Workaround for issue https://github.com/olemartinorg/i3-alternating-layout/issues/15

olemartinorg commented 4 years ago

Does this have a potential to go into an infinite loop? I haven't researched pyi3 much, but if this ends up failing every time I could see the loop going infinite into 100% CPU usage. Might be better to fail hard after a series of fails, or just idle a bit before asking for windows again.

iFreilicht commented 4 years ago

Yeah I'm seeing that as well. It would be safer to use sleep(0.01) instead of continue and have a counter that stops the function after a timeout or a few iterations. Then, if the timeout is reached, just exit the function and don't do anything with the window orientation.

It's not perfect, but good enough until someone get's around to porting to i3ipc-python.

olemartinorg commented 4 years ago

Hi again! Have a look at the recent changes due to #26. I don't think this should be needed anymore, so I'm closing it. Thanks for all the work you did here!