fixes
This commit is contained in:
		| @@ -1,15 +1,19 @@ | ||||
| #!/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 | ||||
| def check_focused(parent; grandparent): | ||||
|   if .focused then | ||||
|     if grandparent and (grandparent.type == "con" or grandparent.type == "workspace") and (grandparent.nodes | length) > 1 then 1 else 0 end | ||||
|   else | ||||
|     . as $current | | ||||
|     ((.nodes[]? | check_focused($current; parent)), | ||||
|      (.floating_nodes[]? | check_focused($current; parent))) | ||||
|   end; | ||||
| find_focused_path | if length >= 3 and .[-2].type=="con" then 1 else 0 end | ||||
|  | ||||
| first(check_focused(null; null) // 0) | ||||
| ') | ||||
|  | ||||
| #echo "$parent_has_sibl" | ||||
| if [ "$parent_has_sibl" = 1 ]; then | ||||
| 	swaymsg "focus parent; focus $1 sibling; focus child" | ||||
| else | ||||
|   | ||||
		Reference in New Issue
	
	Block a user