Description
Sway Version: 1.7
Logs: here
I'm migrating here from i3 because X just slowly descended into graphical madness, I have a few keybindings which call a script. The relevant one to this is:
parent=$(nodePath | jq -rcM '.[-3] | if type == "null" then empty else .id end')
if [ "$parent" != '' ]; then
swaymsg "[con_id=$parent] mark _parent; move window to mark _parent; unmark _parent"
fi
Where nodePath
makes an array of each container down to the focused node, so [-3]
of that is the "grandparent" (parent's parent). So it takes a window, and then makes it a child of it's parent's parent, thus moving it up the tree one level. This works fine on i3, and does absolutely nothing when used in sway. There's no error, the log says it's running the command, but nothing happens. When I go into a console and try to dispatch that set of commands manually with swaymsg
, it also doesn't do anything. The issue doesn't appear to lie further down in the tree fetching or anything, because when inspecting the command as it runs the value of $parent
is consistent and correct, the subsequent commands just aren't doing anything. (Well, sometimes it will actually place the mark, which can be seen by removing the unmark bit, but even then this extremely is inconsistent)
And, while we're here, when I try to move containers to marks in other ways, it's seemingly random and sporadic whether it will work or not. I think it might be failing to do anything whenever the marked container is a direct ancestor of the focused one, but I'm not entirely certain on that. But also, when it does work, the container being moved always loses focus, which is not how the same command behaves in i3.