nixos-config/common/home-manager/wayland/rofi/window.sh

12 lines
321 B
Bash
Raw Normal View History

2022-09-23 23:33:11 -04:00
#!/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)'