olemartinorg / i3-alternating-layout Goto Github PK
View Code? Open in Web Editor NEWScripts to open new windows in i3wm using alternating layouts (splith/splitv) for each new window
License: MIT License
Scripts to open new windows in i3wm using alternating layouts (splith/splitv) for each new window
License: MIT License
No need for xorg-util-macros as far as I can see, works fine without it, but xorg-xprop is needed or you'll get
FileNotFoundError: [Errno 2] No such file or directory: 'xprop': 'xprop'
Is there any reason this project available via pip
?
Would you be open to a PR for this?
The package that needs to be installed are:
python-i3-py
xorg-util-macros
Then you can install this no problem. I'll comment on the AUR package too
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
Hi,
just wanted to let you know that the script crashes from time to time with the following error.
Traceback (most recent call last):
File "/usr/local/bin/alternating_layouts.py", line 106, in <module>
main()
File "/usr/local/bin/alternating_layouts.py", line 99, in main
set_layout()
File "/usr/local/bin/alternating_layouts.py", line 38, in set_layout
current_win = i3.filter(nodes=[], focused=True)
File "/usr/lib/python3.8/site-packages/i3.py", line 519, in filter
if key not in tree or tree[key] != value:
TypeError: argument of type 'NoneType' is not iterable
Despite that, great work. Thank you!
This script sets the layout exactly like I wanted. But, it seems to get screwy when trying to re-arrange windows once tiled. Normal behavior of swapping two vertical windows ontop of eachother no longer works. Is there a way around this behavior?
Hi,
When running i3-alternating-layout, changing from stacked to tabbed to split works. But from that point on, I can't go back to stacked or tabbed.
This is my config:
bindsym $win+t exec "notify-send Layout Tab", layout tabbed
bindsym $win+y exec "notify-send Layout Stack", layout stacking
bindsym $win+u exec "notify-send Layout Split", layout toggle split
So in a workspace with stacked as default, doing win+t then win+u will do what it's supposed to do, but from then on, win+y doesn't work.
Can you reproduce?
Thanks!
Unfortunately i3's functionality of moving containers with move left/right/up/down
(default keybinding mod+Shift+j/k/l/ö/;/arrow-keys) is messed up by the script ...
ideas? @Airblader ?
You can use .git/info/exclude
to exclude files only in your local git repo instead of creating a .gitignore
file.
I am sometimes unable to move a focused window left or right, only up and down. Other times the focused will move two spaces instead of one. I'm running a dual monitor setup, and the issue occurs very often when trying to move a window between monitors.
Any idea how to fix this? Great script, but this is a bit issue for me.
You can get an alternating layout in just two lines (see this comment):
default_orientation vertical
for_window [class="^"] split toggle
Is there something your code achieves that this doesn't?
I followed the instruction in the README, installed i3ipc
with no issue, have python3
installed on my device, and added the exec
line in my configuration, but somehow the split orientation does not alternate. When I try to manually run the python
script, the terminal just hangs. Is that expected?
Hi
I'm part of a project to collect useful i3 scripts and would like to add yours. I did see the license but I thought it proper to say hi and ask :)
Our repo is here:
I have conky running on the desktop and when I create an empty workspace cpu usage of process python goes up to 15-25%. As soon as I open at least one container, cpu goes back to normal.
The script seems to have a problem with detecting an empty workspace?
Just a little comment:
Since c74dfc8 the screenshot is wrong.
Since the split-orientation is calculated based on width/height pressing only $mod+Return
creates a different layout than the depicted one.
Sometimes when I'm running this script it closes itself with this error:
Traceback (most recent call last):
File ".config/i3/scripts/alternating_layouts.py", line 109, in <module>
main()
File ".config/i3/scripts/alternating_layouts.py", line 102, in main
set_layout()
File ".config/i3/scripts/alternating_layouts.py", line 41, in set_layout
current_win = i3.filter(nodes=[], focused=True)
File "/usr/lib/python3.7/site-packages/i3.py", line 508, in filter
tree = msg('get_tree')
File "/usr/lib/python3.7/site-packages/i3.py", line 392, in msg
response = default_socket().get(type, message)
File "/usr/lib/python3.7/site-packages/i3.py", line 181, in get
self.send(msg_type, payload)
File "/usr/lib/python3.7/site-packages/i3.py", line 203, in send
self.socket.sendall(message)
BrokenPipeError: [Errno 32] Broken pipe
I'm running arch and followed the install guide
Seems the primary monitor is working fine, but any other monitors seem to operate as normal. Would you have a quick way around this?
Current implementation splits on the long edge (good) but it does it too early. This breaks any possible multi column layout. This become apparent with ultrawide monitors
WITHOUT i3-alternating-layout
-----------------------
| |
| |
| |
| |
-----------------------
----------- -----------
| | |
| | |
| | |
| | |
----------- -----------
------- ------- -------
| | | |
| | | |
| | | |
| | | |
------- ------- -------
WITH i3-alternating-layout
-----------------------
| |
| |
| |
| |
-----------------------
----------- -----------
| | |
| | |
| | |
| | |
----------- -----------
# next split is what I dont like
----------- ----- -----
| | | |
| | | |
| | | |
| | | |
----------- ----- -----
----------- ----- -----
| | | |
| | |_____|
| | | |
| | | |
----------- ----- -----
DESIRED behaviour
-----------------------
| |
| |
| |
| |
-----------------------
----------- -----------
| | |
| | |
| | |
| | |
----------- -----------
------- ------- -------
| | | |
| | | |
| | | |
| | | |
------- ------- -------
------- ------- -------
| | | |
| | |_______|
| | | |
| | | |
------- ------- -------
I don't know if it is a desired behaviour, but I have found a workaround.
Hi just thought i let you know that the install instructions for arch is not working. There is no longer a package for python-i3-git
and the link in the description is broken.
I got it to work with sudo pip install i3-py
. While troubleshooting this i had a conversation with the maintainer of i3ipc-python
in #i3@freenode, acrisci. according to acrsci i3ipc-python
is a better alternative. And it is at least more convenient to install then using pip, so you might consider porting it to i3ipc-python
.
Really nice script, spiraling layout should be available (and enabled) by default in i3 imo.
I have a minor issue when using this on sway (no problems whatsoever on i3):
Start with a terminal (indicator is in red):
Open another one:
Close the second one:
Please update the AUR repo.
aur/alternating-layouts-git r29.507c84a-1 [+6 ~0.01] [Out-of-date: 2021-12-23] Alternating split directions for the i3-wm
Other tiling window managers have a concept of tiling ratio.
Currently
Windows open with a ratio of 1:1
Expected
Windows open with a ratio of a:b where a and b are configurable
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.