dotfiles/bin/swaytree.sh
Akemi Izuko f6881cea7a
Init again
The dotfiles are back
2022-09-06 23:34:19 -06:00

13 lines
323 B
Bash
Executable file

#!/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