This commit is contained in:
2025-09-22 22:19:32 +00:00
parent 5c078feab5
commit d8eae8a1a5
4 changed files with 97 additions and 17 deletions

View File

@@ -0,0 +1,17 @@
#!/bin/bash
parent_has_sibl=$(swaymsg -t get_tree | jq '
def find_focused_path:
if .focused then [.]
elif .nodes then
[.] + (.nodes[] | find_focused_path | select(length > 0))
else empty
end;
find_focused_path | if length >= 3 and .[-2].type=="con" then 1 else 0 end
')
if [ "$parent_has_sibl" = 1 ]; then
swaymsg "focus parent; focus $1 sibling; focus child"
else
swaymsg "focus $1 sibling; focus child"
fi