12 lines
321 B
Bash
12 lines
321 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
if [ $# -ne 0 ]; then
|
||
|
id=echo "$@" | cut -d ' ' -f1
|
||
|
swaymsg "[con_id=$id]" focus
|
||
|
exit 0
|
||
|
fi
|
||
|
|
||
|
swaymsg -t get_tree |
|
||
|
jq -r '.nodes[].nodes[] | if .nodes then [recurse(.nodes[])] else [] end + .floating_nodes |
|
||
|
.[] | select(.nodes==[]) | ((.id | tostring) + " " + .name)'
|