puntos/.local/bin/sway-switch_window

8 lines
266 B
Bash
Executable file

#!/bin/sh
swaymsg -t get_tree |
jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes | .[] | select(.nodes==[]) | ((.id | tostring) + " " + .name)' |
fuzzel-run -d | {
read -r id name
swaymsg "[con_id=$id]" focus
}