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

Containers shift on i3 restart #14

Closed Syphdias closed 5 years ago

Syphdias commented 5 years ago

If I restart i3 after config changes. Sometimes my containers switch place. Can this be avoided?

Side note since it might be relevant: I use exec_always instead of exec because alternating_layouts.py dies at a restart with BrokenPipeError: [Errno 32] Broken pipe.

# i3 --moreversion
Binary i3 version:  4.16.1 (2019-01-27) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.16.1 (2019-01-27) (pid 1411)abort…)
Loaded i3 config: /home/user/.i3/config (Last modified: Wed 19 Jun 2019 04:52:47 PM CEST, 164 seconds ago)

The i3 binary you just called: /usr/bin/i3
The i3 binary you are running: i3
olemartinorg commented 5 years ago

Huh, that's strange.. I sadly believe it can be avoided. The way this script works is that it keeps switching you between horizontal and vertical splits depending on where you currently have more space available. When the windows have been opened, the script no longer interferes with where they are placed - so if your windows are shuffled when restarting i3wm that's on i3wm.

The broken pipe error happens because the connection to i3wm dies. It could be fixed with some error handling code that tries to reconnect, but honestly I haven't been touching python for very long now, and I haven't used this script myself since making it.. ;-) I'll have a look into it and see if there's an easy fix, though.

Syphdias commented 5 years ago

that's on i3wm

Actually, it's on me. Sorry about that. I have some for_window statements which trigger on certain types of windows to get them to the right position on open (setting width and moving it to the left). This is triggered by the restart, of course. Somehow I never ran into this until now and apparently closed the window that was giving me trouble while debugging this, thus leaving me to believe it was the removal of i3-alternating-layout that fixed the issue.

The broken pipe error happens because the connection to i3wm dies.

It looks like i3-py is no longer being maintained. For now, the exec_always works for me, thank you 😄