You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So let's say we have a window, for example: window = i3.get_tree().find_focused()
Now I'd like to know the .right and .left items relative to our window (if those windows exist anyway).
Meaning the windows where user would end up when invoking i3-msg focus right or i3-msg focus left
I'm sure there must be some way to deduce the .right and .left items, but it's beyond my limited imagination.
Why?
If you are familiar with the examples/focus-next-visible.py, I'm kind of trying to create a focus-right/left-visible.py.
I want to be able to navigate through tabbed containers without switching the visible tab, using the i3 movement keys. I have separate keybind for cycling through the tabs. I really love it like this.
Here you can see hacky interpretation of how I like it. It gets around the issue by simply trying out and navigating back when it opens a tab that was not visible to user. It's slow as pope and flickers like damn.
# i3mover.py --- usage example: # bindsym $mod+l exec --no-startup-id python /path/to/file/i3mover.py right# bindsym $mod+h exec --no-startup-id python /path/to/file/i3mover.py leftimportsysfromi3ipcimportConnectioni3=Connection()
ifsys.argv[1] =="right":
dir="right"adir="left"elifsys.argv[1] =="left":
dir="left"adir="right"else:
exit()
deffind_hidden_windows(tree):
fromsubprocessimportcheck_outputwindows=filter(lambdax: x.window, tree)
hidden_windows= []
forwinwindows:
xprop=check_output(['xprop', '-id', str(w.window)]).decode()
if'_NET_WM_STATE_HIDDEN'inxprop:
hidden_windows.append(w.id)
returnhidden_windowstree=i3.get_tree()
origin=tree.find_focused()
hidden_window_ids=find_hidden_windows(tree)
# do the initial movei3.command(f'focus {dir}')
# check if the initial move got us to hidden windowifi3.get_tree().find_focused().idinhidden_window_ids:
# find the parent tabbed container where we can perform the right/left movecandidate=origin.parentwhileTrue:
ifcandidate.layout=="tabbed":
breakcandidate=candidate.parent# move back, focus the whole tab container and redo the initial movei3.command(f'[con_id="{origin.id}"] focus, [con_id="{candidate.id}"] focus, focus {dir}')
The text was updated successfully, but these errors were encountered:
The find_neighbor_window(window) finds the same window that i3-msg focus right/left finds, but it only looks from inside the output/workspace since that was enough for my case.
I think this is how i3 should work natively. There is a reason why most tiling managers have no tabs. Imo using tabs destroys the workflow if you don't have separate keybinds for cycling through the tabs and moving between not tabbed windows.
So let's say we have a window, for example:
window = i3.get_tree().find_focused()
Now I'd like to know the .right and .left items relative to our window (if those windows exist anyway).
Meaning the windows where user would end up when invoking
i3-msg focus right
ori3-msg focus left
I'm sure there must be some way to deduce the .right and .left items, but it's beyond my limited imagination.
Why?
If you are familiar with the examples/focus-next-visible.py, I'm kind of trying to create a focus-right/left-visible.py.
I want to be able to navigate through tabbed containers without switching the visible tab, using the i3 movement keys. I have separate keybind for cycling through the tabs. I really love it like this.
Here you can see hacky interpretation of how I like it. It gets around the issue by simply trying out and navigating back when it opens a tab that was not visible to user. It's slow as pope and flickers like damn.
The text was updated successfully, but these errors were encountered: