dotfiles/bin/swaytree.sh

13 lines
323 B
Bash
Raw Normal View History

2023-12-23 20:13:47 -07:00
#!/usr/bin/env bash
i=0
swaymsg -t get_tree | jq '.nodes[1].nodes[].representation' | tr -d '"' | \
while read ln; do
space_num="$(swaymsg -t get_tree | jq '.nodes[1].nodes['"$i"'].name' | tr -d '"')"
printf "Workspace %s :: %s\n" "$space_num" "$ln"
i=$(( i + 1 ))
printf "%s" "$ln" | sway_tree 2>/dev/null
done