config
This commit is contained in:
		
							
								
								
									
										17
									
								
								arch-user/bin/sway/focus-cousin.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										17
									
								
								arch-user/bin/sway/focus-cousin.sh
									
									
									
									
									
										Executable 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 | ||||
		Reference in New Issue
	
	Block a user